Question on DateDiff query

Sorry for the easy question but need to verify this part of an existing query.

( DATEDIFF(d,Getdate(),Datetime) >=0 and
DATEDIFF(m,Getdate(),Datetime)<=60)

Is this looking at the current day and the last 60 minutes?
edrz01Asked:
Who is Participating?
 
Ephraim WangoyaConnect With a Mentor Commented:
Ok
DATEDIFF(d,Getdate(),Datetime) >=0
This ensures that the date is at least today

DATEDIFF(m,Getdate(),Datetime)<=60)
This gets data that is 60 months old from today
0
 
Ephraim WangoyaCommented:
Why dont you make it much simpler

DATEDIFF(MINUTE, Getdate(), MyDatetime) <= 60
0
 
edrz01Author Commented:
This is an existing query - I just need to understand what it is doing....
0
 
Ephraim WangoyaCommented:
BTW
M is month, use MINUTE or N
0
 
edrz01Author Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.