Date Comparison in MSSQL

Weller0123
Weller0123 used Ask the Experts™
on
Hello,  I'm trying to compare two dates from two inline views in my where clause.  

Both of the selects in my views work correctly, these fields are dates.  

I want to verify that avail.period is before the date alloc_end.alloc_end from another inlline.

Like....
Where
avail.period <= alloc_end.alloc_end AND.....

Thanks in advance, this simple issue is killing me.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use the BETWEEN operator.

SELECT * ...
WHERE avail.period BETWEEN date1 AND date2
lof
Commented:
you got the answer in your question.
Just join the two inlines and use <= in where.
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial