Information générale
Forum:
Microsoft SQL Server
Titre:
Changing decimal to smalldatetime
Hello group,
When I use the value 2003 in the where field the following works . If I substitute the decimal variable
@SchoolYear for the 2003 it works in one database but not the others. How do I convert a variable from decimal to smalldatetime?
Declare
@BeginYear smalldatetime ,
@EndYear smalldatetime ,
@schoolyear decimal(9,0)
UPDATE [realtestcatcboe].[dbo].schoolyear
SET @schoolyear = schoolyear
print @schoolyear
UPDATE [realtestcatcboe].[dbo].trkdates
SET @BeginYear = ddate
where daytypec = 'BY' and
trkuniq in (select trkuniq from track where schyear = 2003 and
schoolc = '5968')
print @beginYear
UPDATE [realtestcatcboe].[dbo].trkdates
SET @EndYear = ddate
where daytypec = 'EY' and
trkuniq in (select trkuniq from track where schyear = 2003 and
schoolc = '5968')
print @EndYear
Thanks
Jim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement