Ask a Question related to ASP Database, Design and Development.
-
Jerome #1
Now() function in SQL??
Hi,
Before I've queried my Access DB using ASP pages. The SQL string then
could contain: SELECT * FROM table1 WHERE date1>=Now().
This time round my DB is on a SQL Server and I'm still using ASP for
this. But now the Now() function returns an error message!? 'Now is not
a recognized function name'.
How do I tell the SQL Server then to only return future events in 'pure
SQL code'?? I saw the solution somewhere once, but can't find it back ...
Any help is appreciated!
Jerome
Jerome Guest
-
[PHP-DEV] named function arguments (was: Proposal: Dangling comma in function
Christian Schneider wrote: Named parameters - i think is very good idea. I know i would use them. I'm really not sure about the correct... -
#25866 [Bgs]: Using error_reporting() function don't change output of phpinfo() function
ID: 25866 Updated by: sniper@php.net Reported By: sfournier at dmsolutions dot ca Status: Bogus Bug Type: ... -
note 33714 added to function.register-tick-function
please can anyone help me to discover if this function can be used to make a chat ---- Manual Page --... -
note 33575 added to function.register-shutdown-function
If your script exceeds the maximum execution time, and terminates thusly: Fatal error: Maximum execution time of 20 seconds exceeded in - on line... -
note 33132 deleted from function.register-shutdown-function by sniper
Note Submitter: markus@malkusch.de ---- I can't agree with nick at nickjoyce dot com. I use php 4.2.3 on linux and my shutdown function is... -
Nicole Calinoiu #2
Re: Now() function in SQL??
Jerome,
GETDATE() is the SQL Server equivalent of Now().
HTH,
Nicole
"Jerome" <jherr@no.mnhn.spam.lu> wrote in message
news:uPwk2UOOEHA.1392@TK2MSFTNGP09.phx.gbl...> Hi,
>
> Before I've queried my Access DB using ASP pages. The SQL string then
> could contain: SELECT * FROM table1 WHERE date1>=Now().
>
> This time round my DB is on a SQL Server and I'm still using ASP for this.
> But now the Now() function returns an error message!? 'Now is not a
> recognized function name'.
>
> How do I tell the SQL Server then to only return future events in 'pure
> SQL code'?? I saw the solution somewhere once, but can't find it back ...
>
> Any help is appreciated!
>
> Jerome
Nicole Calinoiu Guest
-
el.c. - myLittleTools.net #3
Re: Now() function in SQL??
> could contain: SELECT * FROM table1 WHERE date1>=Now().
SELECT * FROM table1 WHERE date1>=GETDATE()
--
// myLittleTools.net : leading provider of web-based applications.
// myLittleAdmin : online MS SQL manager
// [url]http://www.mylittletools.net[/url]
// [email]webmaster@mylittletools.net[/email]
el.c. - myLittleTools.net Guest
-
Bob Barrows [MVP] #4
Re: Now() function in SQL??
Jerome wrote:
The equivalent T-SQL function is GETDATE()> Hi,
>
> Before I've queried my Access DB using ASP pages. The SQL string then
> could contain: SELECT * FROM table1 WHERE date1>=Now().
>
> This time round my DB is on a SQL Server and I'm still using ASP for
> this. But now the Now() function returns an error message!? 'Now is
> not a recognized function name'.
>
SQL Books Online (usually referred to as BOL) is a great resource. If you've
installed the SQL Server client tools on your machine, it will be in the SQL
Server program group in your Windows Start menu.
It is available online at
[url]http://msdn.microsoft.com/library/en-us/startsql/portal_7ap1.asp[/url]
And a downloadable version is available at:
[url]http://www.microsoft.com/downloads/details.aspx?FamilyID=a6f79cb1-a420-445f-8a4b-bd77a7da194b&displaylang=en[/url]
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Jeswanth Jaishanker #5
Re: Now() function in SQL??
use getdate() instead of now.
"Jerome" <jherr@no.mnhn.spam.lu> wrote in message
news:uPwk2UOOEHA.1392@TK2MSFTNGP09.phx.gbl...> Hi,
>
> Before I've queried my Access DB using ASP pages. The SQL string then
> could contain: SELECT * FROM table1 WHERE date1>=Now().
>
> This time round my DB is on a SQL Server and I'm still using ASP for
> this. But now the Now() function returns an error message!? 'Now is not
> a recognized function name'.
>
> How do I tell the SQL Server then to only return future events in 'pure
> SQL code'?? I saw the solution somewhere once, but can't find it back ...
>
> Any help is appreciated!
>
> Jerome
Jeswanth Jaishanker Guest
-
Aaron [SQL Server MVP] #6
Re: Now() function in SQL??
> This time round my DB is on a SQL Server and I'm still using ASP for
Well, yeah. SQL Server != Access! (Sorry, in Access, that would be, SQL> this. But now the Now() function returns an error message!?
Server <> Access!) ;-)
Now() and GETDATE() and CURRENT_TIMESTAMP are covered here, which might make
for useful reading in general:
[url]http://www.aspfaq.com/2214[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
Aaron [SQL Server MVP] Guest



Reply With Quote

