Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: ciarra41
  • Content: Threads
  • Order by date
  1. ciarra41

    format dates correctly to mm/dd/yyyy

    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
  2. ciarra41

    Rollup to one record with same order number

    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...
  3. ciarra41

    Split field record into multiple fileds at second value occurrance

    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...
  4. ciarra41

    Show data at any giving point of the filed

    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...
  5. ciarra41

    Split a field (space delimiter) into separate columns via 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...
  6. ciarra41

    Joining tables with a like wildcard

    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]'%'
  7. ciarra41

    conver varchar time into datetime

    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.
  8. ciarra41

    multiple values into separate columns by its unique id field

    old table: idnum values 5548 2s1dd 5548 35dd6 5548 4548p 5584 22de1 New table or sql: idnum value1 value2 value3 value4 5548 2s1dd 35dd6 4548p 22de1
  9. ciarra41

    removing dups by min dates keeping the max but sum all the values

    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...
  10. ciarra41

    removing dups by min dates keeping the max

    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 )...
  11. ciarra41

    Arithmetic overflow error

    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...
  12. ciarra41

    move multiple codes in same row-field using a unique account no.

    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...
  13. ciarra41

    split a field

    trying to split theses values into separate fields, there combine in one field. City&State ALTUS OK OKLAHOMA CITY OK CHOCTAW OK PERRY OK Salibury NC
  14. ciarra41

    seeing the last 30 days from max(date)

    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...
  15. ciarra41

    military time conversion

    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...
  16. ciarra41

    how to choose the min between two dates or fields

    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
  17. ciarra41

    update text values

    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
  18. ciarra41

    convert a number value to decimal

    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...
  19. ciarra41

    Rolling minus sum from start of antoher field

    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...
  20. ciarra41

    text DSUM

    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] & "...

Part and Inventory Search

Back
Top