That worked, it just seems like there should be a better solution, but that
is better than nothing at least.

Bernd VanSkiver
[EMAIL PROTECTED]
ColdFusion Developer
----- Original Message -----
From: "Colin Robinson" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 10:01 AM
Subject: RE: SQL Query Builder & Date function problem


> I belive the problem will be that the datepart attribute of DateAdd is not
a
> string. If you did the following it would probably work.
>
> DECLARE @DatePart varchar(10)
> SELECT @DatePart = 'dd'
>
> DECLARE @TmpSQL varchar(200)
>
> SET @TmpSQL ='DateAdd('+@DatePart+', 5, GetDate())'
>
> EXEC(@TmpSQL)
>
> This is probably not the best method but will I think work.
>
>
> -----Original Message-----
> From: Bernd VanSkiver [mailto:[EMAIL PROTECTED]]
> Sent: 05 December 2001 15:24
> 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