We help IT Professionals succeed at work.

sql dates

aneilg
aneilg asked
on
how do i modify the following query
I have the following query bu ti need to get the dat efrom another table,

AND hl.HISTORY_DATE < DATEADD(d,DATEDIFF(d,0, GETDATE()),0)

I wan to do something like
AND hl.HISTORY_DATE < DATEADD(d,DATEDIFF(d,0, SELECT [Extraction_Date] FROM [ELTO_Extraction_Date]),0)

Open in new window

Comment
Watch Question

Commented:
Can you paste the full query?
Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
you need another set of brackets, if that query returns 1 single row:


AND hl.HISTORY_DATE < DATEADD(d,DATEDIFF(d,0, (SELECT [Extraction_Date] FROM [ELTO_Extraction_Date])),0)

Open in new window

Author

Commented:
thanks.