x
login about faq Site discussion (meta-askssc)

SQL time comparison query?

I've been reading on-line about the difficulty of using time in sql.. because I'm having trouble myself and im not sure what approach i should be taking!.

I have an access database and im running sql queries through a web page returning the results, which works fine , but now I want to change in to base the returning results on a new field in the access database called Time. So i need to compare Time > currentsystemtime and i'll base an IF statement off that to display what i want. the Time field is simply things like '09:15' 09:20 etc.

What's the easiest way to do this?. i'm confused by the volume of text that's out there on this. if you can give me any pointers that would be really helpful.

thanks.

more ▼

asked Apr 21 '10 at 04:58 PM in Default

Amendir gravatar image

Amendir
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort oldest

Firstly, this is a SQL Server forum, not an Access Forum. Other than that, in SQL Server, this would be simple as you would use DATEDIFF() on a datetime field (or on a time field in SQL 2008). I am not entirely sure, but the same type of functions should exist in Access.

more ▼

answered Apr 26 '10 at 11:09 AM

RickD gravatar image

RickD
1.6k 1 1 4

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1835
x210
x84
x47
x28

asked: Apr 21 '10 at 04:58 PM

Seen: 1600 times

Last Updated: Apr 21 '10 at 04:58 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.