Ask a Question related to Dreamweaver AppDev, Design and Development.
-
darrel #1
SQL/ASP.NET getting DATE to work in query
I'm grabbing today's date with some ASP.net code:
Dim Today As Date
Today = Microsoft.VisualBasic.Today()
I'm then trying to run a SQL query with the following WHERE statement:
WHERE postdate <= " & Today & "
But it's pulling up records that have a postdate in the future.
A sample:
Today (when written to screen) = 3/23/2005 12:00:00 AM
In the SQL table postdate field = 3/28/2005
Anyone see something wrong with what I have that would be causing this? Is
it because in my code I'm grabbing the time, while SQL is only storing the
date?
-Darrel
darrel Guest
-
Query by date doesn't work
I'm using Informix 9.3, If I run the query in Informix it works, when I run the same query in ColdFusion I get a string to date conversion. I'm... -
date query problem, date in variable
I am using the following query : $query_archief = "SELECT * FROM vacatures where dd_eind_plaatsing < $dd_eind_plaatsing_archief1" note:... -
PHP Date Query
I'm trying to create a recordset where I query a date field in my database. I can't figure the syntax. A little help here: WHERE Category =... -
Date Query
I am attempting to pull information from a database and the main criteria of how I retrieve the information in a date format. The startdate and... -
Date query in ASP
ASP/Scripting newbie question here. I have an access database that I am writing ASP pages to query and return the results. The end user can put... -
Julian Roberts #2
Re: SQL/ASP.NET getting DATE to work in query
Use the datediff() function. eg
where datediff('d',myfield,date())<=0
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
darrel #3
Re: SQL/ASP.NET getting DATE to work in query
So, that's the difference between my date in the database and todays date in> Use the datediff() function. eg
>
> where datediff('d',myfield,date())<=0
days? How is the day measured? Ie, is that the number of days since 1900 (or
whatever the default date is in SQL?
-Darrel
darrel Guest
-
darrel #4
Re: SQL/ASP.NET getting DATE to work in query
> Use the datediff() function. eg
Hmm...well, I tried this:>
> where datediff('d',myfield,date())<=0
datediff('d',pulldate,date()) <= 0
and got this:
'date' is not a recognized function name.
-Darrel
darrel Guest



Reply With Quote

