Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to store time (not date) in SQL and query from VFP
Message
 
 
À
03/03/2009 15:53:16
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01297626
Message ID:
01385380
Vues:
57
>>I see, never mind then. I wanted to help someone by easier way. I'll play at night myself.
>
>Look up convert: select convert(char(8), schrun, 108) as mytime from msgschdl
>
>works for me (the datetime column is schrun and the table is msgschdl)

Very nice, thanks, Tracy.
declare @test table (myValue varchar(max), dt datetime)

INSERT INTO @Test (MyValue, dt) 
VALUES ('adddd', GETDATE()),
 ('bgfgfg', getdate()-10),
 ('bgfgfg', getdate()-15)

SELECT convert(char(8), dt, 108) as mytime 
FROM   @Test where myValue > 'a' and myValue < 'mzzzzzzzzzzzzzzzzzzzzzzzzz'
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform