you need to use convert (if your full date is a datetime datatype)

try this:
Update AV_Cluster
set StatsDate = 
CONVERT (datetime, '13/' + [AV_Cluster].[Month] + '/' + [AV_Cluster].[year],
103)


the above syntax might not be completely right, but play around with CONVERT
anyway, read SQL Books Online for more help on the formats (103 in this case
being dd/mm/yyyy)


> -----Original Message-----
> From: Giles Roadnight [mailto:[EMAIL PROTECTED]]
> Sent: 03 October 2002 14:43
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] OT: SQL Server Query
> 
> 
> Hi
> 
> Sorry for the off topic post.
> 
> I have some SQL server tables that have a month and a year 
> column and I want
> to put them both into one date column. I have tried the 
> follwoing query but
> all of hte dates get set to the first of january 1900.
> 
> Update AV_Cluster
> set StatsDate = 13/[AV_Cluster].[Month]/[AV_Cluster].[year]
> 
> I have tried putting quotes around bits of the date and 
> adding &'s and +'s
> in to join the string together but I got lots of errors.
> What am I doing wrong?
> 
> Thanks
> 
> Giles
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to