can I create Date Variable?

From: AP <adamwphoenix_at_gmail.com>
Date: Thu, 4 Sep 2008 07:01:27 -0700 (PDT)
Message-ID: <d3144b5e-a9a8-431b-a244-1faa8272b7da@s20g2000prd.googlegroups.com>


I have a union query that combines the results of several queries. Each of these queries has a condition to extract the row where the date is between 1/1/08 and 1/31/08. Each month when I run this I have to do a find and replace to change the date range. Is there a way to declare a date variable and reference that in the select statement instead of the literal date?

For example
instead of between 1/1/08 and 1/31/08

it would be something like...

startDate = 1/1/08
endDate = 1/31/08

statement = between startdate and enddate

Thanks in advance Received on Thu Sep 04 2008 - 09:01:27 CDT

Original text of this message