|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Datetime Comparison Problem
Hi,
I have a comparison problem. I have table that you can see below. It's like this: RECTIME1 RECTARIH1 10:00:00 22.10.2007 06:00:00 10.10.2007 03:00:00 13.05.2007 There is no date data in RECTIME1 and there is no time data in RECTARIH1. I want to query the RECTIME1 column which includes time data. I try Code:
WHERE RECTIME1 < '10:00:00' AND RECTIME1 > '06:00:00' Thanks |
|
#2
|
||||
|
||||
|
Quote:
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
Quote:
Thanks for your response. I will switch one column later. But, we have lots of records in this table. I have to make this query. So I need help. |
|
#4
|
|||
|
|||
|
Quote:
Mayhap using the datepart functionality would be good enough for you WHERE Datepart(hh,RECTIME1) < 10 AND Datepart(hh,RECTIME1) >= 6 |
|
#5
|
|||
|
|||
|
Quote:
Thank you so much. It works. ![]() PS: I am new at SQL programming. I'm learning... |
|
#6
|
|||
|
|||
|
Quote:
Read up on SQL book online (BoL). The number of Date/time functions available is quite daunting at first, but each is very very useful in the correct circumstances. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Datetime Comparison Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|