Try this:

SELECT Datepart(d,getdate())

Mfg
Gerd Morjan

-----Original Message-----
From: Steven Dworman [mailto:[EMAIL PROTECTED]] 
Sent: Mittwoch, 05. Dezember 2001 16:53
To: SQL
Subject: RE: SQL Query Builder & Date function problem

try this...

DECLARE @DatePart varchar(10)
@DatePart = 'day'

SELECT DateAdd(@DatePart, 5, GetDate())


-----Original Message-----
From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:24 AM
To: SQL
Subject: SQL Query Builder & Date function problem


Does anyone know if Microsoft SQL 2000 has a query builder similar to
the
query builder in ColdFusion?  I think I remember running in to it once
before, but I cannot find it again.  It seems like the query builder in
SQL
was more advanced than ColdFusion's as well.

Also, is there a way to use a SQL variable in a Date function?  Below is
an
example of what I am trying to do:

DECLARE @DatePart varchar(10)
SELECT @DatePart = 'dd'

SELECT DateAdd(@DatePart, 5, GetDate())


When I run this I get the following error message: "Invalid parameter 1
specified for dateadd."

Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to