Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2012-05-14 : 06:07:30
|
| I have query like thisSelect NVL(SUM(TRANS_QTY),0) FROM IC_TRAN_PND where ITEM_ID IN (130,131) and line_type=1 AND COMPLETED_IND=1 AND to_date(TRANS_DATE,'DD-MON-YY') Between to_date('01-JAN-12','DD-MON-YY') and to_date(('04-JAN-12'),'DD-MON-YY')this query not returning the total sum of records between the two date ranges.Do I need to convert something. Regards |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-05-14 : 06:14:11
|
This is a Microsoft SQL Server forum.If you have Oracle questions, please make them over at www.dbforums.comIn general, when sorting and searching date values, format them in ISO style YYYY-MM-DDSelect NVL(SUM(TRANS_QTY), 0)FROM IC_TRAN_PNDwhere ITEM_ID IN (130, 131) and line_type = 1 AND COMPLETED_IND = 1 AND to_date(TRANS_DATE, 'YYYYMMDD') Between to_date('01-JAN-12', 'YYYYMMDD') and to_date('04-JAN-12', 'YYYYMMDD') N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|