Click here to Skip to main content
15,900,254 members
Home / Discussions / Database
   

Database

 
GeneralRe: MS SQL Server 2000 on Windows XP Professional Pin
__yash__20-Nov-07 21:29
professional__yash__20-Nov-07 21:29 
GeneralRe: MS SQL Server 2000 on Windows XP Professional Pin
BugWacker21-Nov-07 3:29
BugWacker21-Nov-07 3:29 
AnswerRe: MS SQL Server 2000 on Windows XP Professional Pin
Marek Grzenkowicz21-Nov-07 0:08
Marek Grzenkowicz21-Nov-07 0:08 
GeneralRe: MS SQL Server 2000 on Windows XP Professional Pin
__yash__21-Nov-07 0:20
professional__yash__21-Nov-07 0:20 
QuestionINSERT INTO and when is table updated Pin
john john mackey20-Nov-07 11:55
john john mackey20-Nov-07 11:55 
AnswerRe: INSERT INTO and when is table updated Pin
john john mackey20-Nov-07 13:07
john john mackey20-Nov-07 13:07 
GeneralRe: INSERT INTO and when is table updated Pin
ChandraRam21-Nov-07 1:09
ChandraRam21-Nov-07 1:09 
QuestionComparing only the TIME part of DATETIME Pin
Chris Meech20-Nov-07 5:51
Chris Meech20-Nov-07 5:51 
I have a column called AUDIT_EVENT_DATE that is a DATETIME stamp for when an event occurred. I'm trying to put a query together that lets me see only the records for events that occurred between 18:30 and 18:45 for the last two months.
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
 where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
   and audit_event_date between to_date('18:30:00','HH24:MI:SS') and to_date('18:45:00','HH24:MI:SS')
 order by audit_event_date
The above only supplies me with audit records dated on November the 1st. I think that's because of a truncation thing that is happening. Wouldn't it be nice if there was a handy function called TIME_only, and then I could do this instead
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
 where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
   and time_only(audit_event_date) between time_only(to_date('18:29:59','HH24:MI:SS')) and time_only(to_date('19:00:00','HH24:MI:SS'))
 order by audit_event_date

Anybody have any ideas of how to do this? Thanks.

Chris Meech
I am Canadian. [heard in a local bar]
Donate to help Conquer Cancer[^]

AnswerRe: Comparing only the TIME part of DATETIME Pin
andyharman20-Nov-07 6:36
professionalandyharman20-Nov-07 6:36 
GeneralRe: Comparing only the TIME part of DATETIME Pin
Chris Meech20-Nov-07 7:13
Chris Meech20-Nov-07 7:13 
QuestionT-SQL Question Pin
ffowler20-Nov-07 5:42
ffowler20-Nov-07 5:42 
AnswerRe: T-SQL Question Pin
andyharman20-Nov-07 6:41
professionalandyharman20-Nov-07 6:41 
GeneralRe: T-SQL Question Pin
ffowler20-Nov-07 7:21
ffowler20-Nov-07 7:21 
GeneralRe: T-SQL Question Pin
astanton197820-Nov-07 9:43
astanton197820-Nov-07 9:43 
GeneralRe: T-SQL Question Pin
ffowler20-Nov-07 9:51
ffowler20-Nov-07 9:51 
GeneralRe: T-SQL Question Pin
ffowler20-Nov-07 9:54
ffowler20-Nov-07 9:54 
QuestionDirrerence Between these Two Queries Pin
Vimalsoft(Pty) Ltd20-Nov-07 3:38
professionalVimalsoft(Pty) Ltd20-Nov-07 3:38 
AnswerRe: Dirrerence Between these Two Queries Pin
Jason Lepack (LeppyR64)20-Nov-07 3:49
Jason Lepack (LeppyR64)20-Nov-07 3:49 
GeneralRe: Dirrerence Between these Two Queries Pin
Vimalsoft(Pty) Ltd20-Nov-07 4:02
professionalVimalsoft(Pty) Ltd20-Nov-07 4:02 
GeneralRe: Dirrerence Between these Two Queries Pin
Jason Lepack (LeppyR64)20-Nov-07 4:27
Jason Lepack (LeppyR64)20-Nov-07 4:27 
GeneralRe: Dirrerence Between these Two Queries Pin
Vimalsoft(Pty) Ltd20-Nov-07 20:27
professionalVimalsoft(Pty) Ltd20-Nov-07 20:27 
GeneralRe: Dirrerence Between these Two Queries Pin
Vimalsoft(Pty) Ltd20-Nov-07 21:06
professionalVimalsoft(Pty) Ltd20-Nov-07 21:06 
GeneralRe: Dirrerence Between these Two Queries Pin
Jason Lepack (LeppyR64)21-Nov-07 2:33
Jason Lepack (LeppyR64)21-Nov-07 2:33 
GeneralRe: Dirrerence Between these Two Queries Pin
Vimalsoft(Pty) Ltd21-Nov-07 3:46
professionalVimalsoft(Pty) Ltd21-Nov-07 3:46 
QuestionTDS buffer length too large Pin
amhase_codeProject20-Nov-07 2:55
amhase_codeProject20-Nov-07 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.