|
 |
asp_web_howto thread: converting date to the right value
Message #1 by "Eric Van Camp" <eric@a...> on Wed, 24 Jul 2002 21:58:35 +0200
|
|
i have the number for a date in my database ( eg 37462 for 25th of july
20002)
now i have a form in which a user fills in a date ( using dropdowns)...
the string is turned into a date using Cdate() function, but then i need to
know whether this date is already in the database...
can i write a sql querystring in which i turn my number in the database into
a date to compare it with the date the user filled in... ps:date is a field
in my calendar table
i thought of something like
sql=" select * from calendar where Cdate(date)='#"&strdate&"#'"
i know this does not work but does anyone has any suggestion how i should do
this?
eric
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 25 Jul 2002 11:37:36 +1000
|
|
Eric,
Perhaps if you first explained how your "numbering" system works, then we
can help you. If we don't know how/why you are using numbers to represent
dates, it's very difficult for us to suggest a mechanism that will
accurately compare *strings* supplied by the user (01/01/2002) with
*numbers* (eg 37462) in your database.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Eric Van Camp" <eric@a...>
Subject: [asp_web_howto] converting date to the right value
: i have the number for a date in my database ( eg 37462 for 25th of july
: 20002)
: now i have a form in which a user fills in a date ( using dropdowns)...
: the string is turned into a date using Cdate() function, but then i need
to
: know whether this date is already in the database...
: can i write a sql querystring in which i turn my number in the database
into
: a date to compare it with the date the user filled in... ps:date is a
field
: in my calendar table
: i thought of something like
: sql=" select * from calendar where Cdate(date)='#"&strdate&"#'"
: i know this does not work but does anyone has any suggestion how i should
do
: this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |