|
 |
asp_web_howto thread: Sending Todays date via url to database
Message #1 by "Naveed Ahmed" <naveeda@c...> on Sun, 9 Feb 2003 17:53:26
|
|
Hi,
I need urgent help with this one. I have a database driven website using
Access/ASP/VB that provides information on club nights in the uk.
The problem is that the homepage shows what club nights are on for that
particular night, which has to be done when the page loads up.
So the how do i get the homepage to pull the information for that day from
the database automaticlly ???
The only way round this i could think of wasto create a splash page which
has a 'Enter' link which would then send todays date/day via the url to
recodset on the homepage. The only problem i have with that is how do i
send todays date in the url ??
Thanks
Naveed
Message #2 by "Scott Heath" <scott@s...> on Sun, 9 Feb 2003 13:05:10 -0600
|
|
How about passing the date in the SQL query? I do that in my site and it
works fine. Do something like:
"SQLquery = Select * from tablename where date = " & date;
Hope that helps,
SCott
-----Original Message-----
From: Naveed Ahmed [mailto:naveeda@c...]
Sent: Sunday, February 09, 2003 5:53 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Sending Todays date via url to database
Hi,
I need urgent help with this one. I have a database driven website using
Access/ASP/VB that provides information on club nights in the uk.
The problem is that the homepage shows what club nights are on for that
particular night, which has to be done when the page loads up.
So the how do i get the homepage to pull the information for that day
from
the database automaticlly ???
The only way round this i could think of wasto create a splash page
which
has a 'Enter' link which would then send todays date/day via the url to
recodset on the homepage. The only problem i have with that is how do i
send todays date in the url ??
Thanks
Naveed
Message #3 by "Ken Schaefer" <ken@a...> on Mon, 10 Feb 2003 11:50:54 +1100
|
|
Just about all databases have a function you can call the returns the
current system date.
For MS Access:
strSQL = _
"SELECT field1, field2, field3 " & _
"FROM Events " & _
"WHERE EventDate = Date()"
For MS SQL Server
strSQL = _
"SELECT field1, field2, field3 " & _
"FROM Events " & _
"WHERE CAST(CONVERT(varChar, EventDate, 112) AS SmallDateTime)
CAST(CONVERT(varChar, GetDate(), 112) AS SmallDateTime)"
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Naveed Ahmed" <naveeda@c...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Sunday, February 09, 2003 5:53 PM
Subject: [asp_web_howto] Sending Todays date via url to database
: Hi,
:
: I need urgent help with this one. I have a database driven website using
: Access/ASP/VB that provides information on club nights in the uk.
:
: The problem is that the homepage shows what club nights are on for that
: particular night, which has to be done when the page loads up.
:
: So the how do i get the homepage to pull the information for that day from
: the database automaticlly ???
:
: The only way round this i could think of wasto create a splash page which
: has a 'Enter' link which would then send todays date/day via the url to
: recodset on the homepage. The only problem i have with that is how do i
: send todays date in the url ??
:
: Thanks
: Naveed
|
|
 |