• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2074
  • Last Modified:

Sysdate expressed in MS-Query

I need to express the system date minus three days in MS-Query.  How do I do that?

Thanks guys,
Robyn
0
robyncoffey
Asked:
robyncoffey
  • 3
  • 2
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT DATEADD(dd, -3, GETDATE())
select Getdate()-3
0
 
robyncoffeyAuthor Commented:
We're doing this through the Query Wizard.  We are getting a 'invalid character' error message when we enter SELECT DATEADD(dd, -3, GETDATE()).  We had already tried Getdate()-3 previously with the same error message resulting.  help!
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
i dont find any issue in Query wizard, can u try the same in Query analyser ?
0
 
robyncoffeyAuthor Commented:
Are you putting SELECT DATEADD(dd, -3, GETDATE()) in the where clause of the query wizard box or just DATEADD(dd, -3, GETDATE()) ?
0
 
robyncoffeyAuthor Commented:
We tried day instead of dd in the DATEADD function and it seems to be working. Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now