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!

Trying to pull data from last 30 days only

Status
Not open for further replies.

Hacim

Technical User
Sep 5, 2002
63
US
i'm trying to edit a sql statement from an existing custom report that involves technician time charges.
the existing statement shows time charge data for "yesterday"
I can't figure how to write the statement for the last 30 days.
the existing state reads: where datediff(day, vtimecharges.startdate, getdate()) =1 and skillcode = 'ELE'

any help would be appreciated
 
datediff(day, vtimecharges.startdate, getdate()) <=30

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks for your response. just got back to work.
SQL seems to recognize the = sign as the begining of a statement after the < sign I get an error. thanks for trying
 
please provide the SQL string youare trying to use - note that all I changed vsyour original post is tochane = 1 to <=30. If te originl works then the update should too

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top