will resolve your problem.
"Simon Harris" wrote:
> Hi All,
>
> I have a table with three columns - price,fromtime and totime
>
> The fromtime/totime columns are date/time format - I have stored just a time
> in them - e.g. 8:30 / 10:30
>
> I am trying to run queries based on time alone (Not dates) but do not seems
> to get any results back.
>
> e.g.
>
> Select * from charge_rates where '10:30' between fromtime and endtime
> (10:30 being a user defined value)
>
> I have also tried:
> Select * from charge_rates whereconvert(datetime,'10:30',114) between
> fromtime and endtime
> and...
> Select * from charge_rates whereconvert(datetime,'10:30',104) between
> fromtime and endtime
>
> None seem to return results I need. A collegue suggested using datepart to
> compare the hour, problem is we dont know what the minute is...e.g: can be
> 10:15, 10:30...and so on.
>
> Any help will be appreciated! :)
>
> Regards,
> Simon.
>
> --
> -
> * Please reply to group for the benefit of all
> * Found the answer to your own question? Post it!
> * Get a useful reply to one of your posts?...post an answer to another one
> * Search first, post later :
http://www.google.co.uk/groups
> * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
>
>