I have these dates fomatted like these mm/dd/yy to mm/dd/yyyy I tried to convert function but to luck
01/21/98
07/17/96
12/15/04
Need them to look like this"
01/21/1998
07/17/1996
12/15/2004
any help would do
I have multiple rows with duplicate orders numbers and separate order types where as some are null and some are not. How can I roll these up into one record by order number and where there’s null it will pick the corresponding value that is not null for the same order number? It can be two are...
I'm trying to parse a field whereas at any second occurrance of a character value(') start from there and drop them into another field separately by ('). The below query works but keeps ASC the values
exp.
tr'1245'lt'ba'max'74
tr'1845'lkt'bf1a'7max'749
It needs to start at the second (') and...
I have a list of file names in a table; I'm only trying to query the report name starting at the last forward(\) slash. So anything starting at the last slash will be the report name.
k:\documents\myfolder1\reports\analysis\march\04\ordersReports.xls
It should look like this. Any example sql...
It combines all the numers in one unique jobnumber and separate columns per unique orderNM
OLD
jobNumbers orderNM
78506766 0850 0853 2542 9907
78506766 0850 0853 2592
78506766 0851 0853 2542 4801 9907
78506766 0851 0853 2542 9907
78506766 0851 0853 2592
End Result
jobNumbers orderNm1...
I trying to join two tables with table a has a single value whereas the table b may have multiple values but still has the value in table a.
Possible easy fix?
select a.* FROM
tableA as a
inner join
tableB as b
on b.CODE = LIKE '%'[a.code]'%'
Hi there;
I'm trying to convert this 11:15:AM into a datetime format.
The problem I see is the second (:) I've tried to remove it but still I'm getting an error.
I've tried these:
CONVERT(varchar(8),mytime,108)
RTRIM(SUBSTRING(mytime,1,5)+' '+SUBSTRING(mytime,7,2))
any other suggestions.
Hi there,
I've recently submitted a thread #183-1648000 to remove all the min dated records but it kept the max.
I need to do the same thing but I need it to add the values in each of the rows before it roll up to max date. The sql below works but it only summing the max value from the date...
I’m trying to remove duplicates records ids keeping the max date and deleting the min.
Delete from mytable
where id=(select a.id, MIN(CONVERT(varchar(12),a.dates,101)) from mytable as a where a.id=mytable.id
and id IN(select id, count(*) rcrds from mytable group by id HAVING count(id) >1 )...
I'm getting this error 8115, which is the dreaded converting issue.
The problem is I'm not associating it to a particular value, just counting and using a mulitplier. If you remove those two lines where I got (fails here) it runs fine. I've tried converting it to a bigint, int, and isnumeric...
I have some duplicate account numbers but the codes are not. I’m trying to move each codes for the same account number into one field separated by commas
00629144 HAMR1
00629144 HUME2
Move the codes in the same row separated using a comma for the unique account number
00629797 HAMR, HUM...
I’m trying to pull only the values from a date max value going back 30 days. So if I select the max date field it will pull that max date going back only 30 days.
Here’s what I have in mind but it’s pulling everything.
Having Max(date_post)> dateadd(d,datediff(d,0,date_post),-30)
Or a...
Need a way (T-SQL) to convert military time to a standard time format.
1338= 01:38:00 PM
1112= 11:12:00 AM
1135= 11:35:00 AM
1149= 11:49:00 PM
2014= 08:14:00 PM
22:35= 10:35:00 PM
I've tried this so far from an earlier thread but I'm having a little trouble; any help would do
select mycol...
I'm trying to show the min date in another field from two date fields. Both fields are in the table mytable
mytable
dt_date1 dt_date2 min_date
1/2/2002 1/8/2002 1/2/2002
2/6/2007 2/14/2003 2/14/2003
3/25/2009 3/20/2005 3/20/2005
I'm trying to remove 0:00:00 from a text field using left, right, mid or a substr function in a query
Old:
4/01/2007 0:00:00
11/01/2007 0:00:00
New:
4/01/2007
11/01/2007
I need to convert numbers or currency like below to two decimal places. It's not working in the properties either.
I'm getting this:
27.3333333333333
55.0833333333333
null
91.7875
0
8
But I need this:
27.33
55.08
0.00
91.78
0.00
8.00
SELECT Master.rep, Sum([correct total]/12) AS TTl
FROM...
I need to subtract fields (“MKT_TOTAL”-“OrgTotal”) in first record value (“MKT_TOTAL’) it will go all the way down like a rolling sum but minus. When the beginning total runs out it should show 0 instead of a minus number.
Table name= bus_sales
Goal:
BUSINESS_NAME UNID ORDID OrgTotal...
1.I'm getting a error on this-I need to change this to do it using text.
2. Using a date field (Period) can you add and modify it to subtract the last date entered. I'm not sure where to put the "Period" field using what I have below.
DSum("MKTG_COST","MKT","OrderID = " & [ORID] & "...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.