P
Paul
I'm trying to create a more efficient way of changing the
date range criterion I use in database results
criterion. I frequently have to change the database
results properties across a series of pages to alter the
dates of articles displayed on those pages. The custom
query I currently use is:
SELECT * FROM Articles WHERE ("Article Date" Between
#7/1/2003# AND Date( )) ORDER BY "Article Date" DESC
I want to replace the hard coded date #7/1/2003# with a
variable that I can set in the source of the page, or
better yet, on a single include page that would be pulled
into all the pages using this same database query. I
have done this successfully with other types of queries,
but I can't figure out the right syntax when it comes to
the date property.
Here is how I am defining the variable in HTML view:
<%
Dim MyDate
Date = "9/1/2003"
%>
And here are several variations of the syntax I tried to
use for my defined variable. I placed and tested each of
these within the SQL query in the HTML view. All result
in errors when I try to view my page in a browser.
"::MyDate::"
""::MyDate::""
'%::MyDate::%'
#::MyDate::#
I believe that I have the syntax wrong where I am trying
to insert my defined variable into the SQL query in HTML
view. Can anyone provide help? Thanks.
date range criterion I use in database results
criterion. I frequently have to change the database
results properties across a series of pages to alter the
dates of articles displayed on those pages. The custom
query I currently use is:
SELECT * FROM Articles WHERE ("Article Date" Between
#7/1/2003# AND Date( )) ORDER BY "Article Date" DESC
I want to replace the hard coded date #7/1/2003# with a
variable that I can set in the source of the page, or
better yet, on a single include page that would be pulled
into all the pages using this same database query. I
have done this successfully with other types of queries,
but I can't figure out the right syntax when it comes to
the date property.
Here is how I am defining the variable in HTML view:
<%
Dim MyDate
Date = "9/1/2003"
%>
And here are several variations of the syntax I tried to
use for my defined variable. I placed and tested each of
these within the SQL query in the HTML view. All result
in errors when I try to view my page in a browser.
"::MyDate::"
""::MyDate::""
'%::MyDate::%'
#::MyDate::#
I believe that I have the syntax wrong where I am trying
to insert my defined variable into the SQL query in HTML
view. Can anyone provide help? Thanks.