beetlebailey
Programmer
Hello I am trying to write a query based on today's date:
select partno as [Part Number]
from testers
group by partno, line, [day], [hour]
HAVING line=501 and [day]=20 and [hour]=6
order by line, [day], [hour]
In the HAVING statement I would like to have SQL put in today's date automatically. This query will be used on a daily basis. Is this possible? I have tried today(), now(), day(), datepart(dd,date) with no success. Thanks for any suggestions.
select partno as [Part Number]
from testers
group by partno, line, [day], [hour]
HAVING line=501 and [day]=20 and [hour]=6
order by line, [day], [hour]
In the HAVING statement I would like to have SQL put in today's date automatically. This query will be used on a daily basis. Is this possible? I have tried today(), now(), day(), datepart(dd,date) with no success. Thanks for any suggestions.