Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Where Statement Using Time

Author  Topic 

stharish
Starting Member

43 Posts

Posted - 2012-01-25 : 21:16:39
Using Microsoft SQL server...

I have a query that includes rows of aircraft flight legs with a flight time column displayed like 02:40:00.0000000.

I want to use a where statement to include only rows where flight time is greater than 02:30 (2 hours and 30 minutes).

Invalid code:

WHERE Legs.FlightTime>2:30

Suggestions??

stharish
Starting Member

43 Posts

Posted - 2012-01-25 : 21:19:04
Solved with quotes...

WHERE Legs.FlightTime>'2:30'
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-26 : 08:52:32
is FlightTime of time datatype?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -