Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a different col based upon another col

Status
Not open for further replies.

megwich

Programmer
Mar 5, 2005
1
GB
Hi
I have a table that has the following cols

RouteID,TimeDepart,TimeArrival
for example a row may have
1020,700,-1
i.e. RouteID = 1020, timedepart = 700, TimeArrival = -1
most rows conform to a timedepart having a positive value and the timearrival being -1 (effectively stating that the route arrives and departs at the same time)
the odd row, though has

RouteID = 1021, Timedepart = -1, TimeArrival = 900


I would like to select all rows that have a positive number(either Timedepart or TimeArrival), this will give me a count of how many routes have a time allocated to them. is there a sql statement that will allow me to get a count based upon either col having a positive number


Thank you for your help

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top