Re: Syntax problem?
From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 09/01/04
- Next message: Aaron [SQL Server MVP]: "Re: Query Syntax"
- Previous message: Eddie: "Syntax problem?"
- In reply to: Eddie: "Syntax problem?"
- Next in thread: Eddie: "Re: Syntax problem?"
- Reply: Eddie: "Re: Syntax problem?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Sep 2004 17:14:50 -0400
Put the date into a variable.
DECLARE @d1 SMALLDATETIME, @d2 SMALLDATETIME
SET @d1 = GETDATE()-30
SET @d2 = GETDATE()
SELECT * FROM GetNewClients(@d1, @d2)
And please stop using ambiguous date formats. If you're going to allow the
engine to implicitly convert your date, at least prevent it from screwing it
up. Use YYYYMMDD.
-- http://www.aspfaq.com/ (Reverse address to reply.) "Eddie" <Eddie@discussions.microsoft.com> wrote in message news:E298954B-500E-488A-ABA4-16689462F8F7@microsoft.com... > I'm having trouble with something which I think I shouldn't be having trouble > with... > > I'd like to do a: > > select * from GetNewClients(getdate() - 30, getdate()) > > But I get a: > > Server: Msg 170, Level 15, State 1, Line 1 > Line 1: Incorrect syntax near '('. > > However, this and kin work: select * from GetNewClients('1/1/2004', > '6/1/2004'), etc.. > > What's going on here? > > Thanks. > > Eddie
- Next message: Aaron [SQL Server MVP]: "Re: Query Syntax"
- Previous message: Eddie: "Syntax problem?"
- In reply to: Eddie: "Syntax problem?"
- Next in thread: Eddie: "Re: Syntax problem?"
- Reply: Eddie: "Re: Syntax problem?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|