Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing decimal to smalldatetime
Message
De
16/08/2002 16:08:14
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Changing decimal to smalldatetime
Divers
Thread ID:
00690528
Message ID:
00690528
Vues:
59
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
Fil
Voir

Click here to load this message in the networking platform