Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select between
Message
 
 
À
25/07/2006 04:55:12
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01139595
Message ID:
01139612
Vues:
11
>I have a problem with select records from table.
>There are one record in table mydb.dbo.R_mytable with datetime field
>mydatetime={25.07.2006 12:27}
>
>But SQL-command:
>select * from mydb.dbo.R_mytable where mydatetime between
>convert(datetime,'05.07.2006',104) and convert(datetime,'25.07.2006',104)
>
>not find records.
>
select * from mydb.dbo.R_mytable 
where mydatetime >= DATEADD(dd, DATEDIFF(dd, dt, '05.07.2006'), dt)
  AND mydatetime < DATEADD(dd, DATEDIFF(dd, dt, '05.07.2006'), dt)+1
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform