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 |
|
vijayanto
Starting Member
16 Posts |
Posted - 2009-06-01 : 07:56:19
|
| hi friends,i did stored procedure in the sql server while i got the problemi want to get quantity for previous date the query is following below;SELECT DATEADD(year, - 1, T0.DocDate) AS Expr1, T0.DocDate, T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription, T1.QuantityFROM OINV AS T0 INNER JOIN INV1 AS T1 ON T0.DocEntry = T1.DocEntry |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-01 : 08:05:06
|
WHERE t0.docdate >= datediff(day, 1, getdate()) and t0.docdate < datediff(day, 0, getdate()) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
SQLRatankalwa
Starting Member
42 Posts |
Posted - 2009-06-01 : 11:14:26
|
| SELECT DATEADD(year, - 1, T0.DocDate) AS Expr1, T0.DocDate, T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription, T1.QuantityFROM OINV AS T0 INNER JOININV1 AS T1 ON T0.DocEntry = T1.DocEntryWhere T0.DocDate Between GetDate() - 1 and GetDate() + 1Revalsys Technologies Private Limitedhttp://www.revalsys.com |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-01 : 13:42:47
|
quote: Originally posted by SQLRatankalwa SELECT DATEADD(year, - 1, T0.DocDate) AS Expr1, T0.DocDate, T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription, T1.QuantityFROM OINV AS T0 INNER JOININV1 AS T1 ON T0.DocEntry = T1.DocEntryWhere T0.DocDate Between GetDate() - 1 and GetDate() + 1Revalsys Technologies Private Limitedhttp://www.revalsys.com
this will all data from previous day current time till next day current time which was not OP asked for |
 |
|
|
|
|
|
|
|