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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collect information over the last x days? 1

Status
Not open for further replies.

NavMen

Vendor
Jul 6, 2004
35
NL
Hi

I try to collect all tranactions of today with the following query and that works fine, but now I try to get information from the last 7 days and I don't get it to work.

select * from STH_POL_REPORT where date = CONVERT(varchar(30),getdate(),101)

Date field format is: 02/28/2008 (dd/mm/yyyy)

Also how can you generate a list of transaction per month?

Thanks,

Navmen

 
02/28/2008 (dd/mm/yyyy)???
I never saw 28 month :)

Code:
SELECT *
       FROM STH_POL_REPORT
WHERE Date >= DateAdd(dd,DateDiff(dd,0,GETDATE()),-7)
That would give you ALL transactions from midnight of the day before 7 up to now.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Thanks that works fine!
It is mm/dd/yyyy, Slip of the finger :)


What about montly reporting of the tranactions?

/Navmen
 
Start a new thread. I am not a reporting guy :)

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top