Click here to Skip to main content
15,911,646 members
Home / Discussions / Database
   

Database

 
QuestionHow get file date with scripts Pin
topcatalpha6-Aug-08 5:07
topcatalpha6-Aug-08 5:07 
AnswerRe: How get file date with scripts Pin
Wendelius6-Aug-08 9:02
mentorWendelius6-Aug-08 9:02 
AnswerRe: How get file date with scripts Pin
Ashfield6-Aug-08 20:52
Ashfield6-Aug-08 20:52 
GeneralRe: How get file date with scripts Pin
topcatalpha6-Aug-08 21:24
topcatalpha6-Aug-08 21:24 
QuestionCreate login On SQL Server Pin
Rupsaa6-Aug-08 4:19
Rupsaa6-Aug-08 4:19 
AnswerRe: Create login On SQL Server Pin
Ashfield6-Aug-08 4:25
Ashfield6-Aug-08 4:25 
Questionadding the time component of two dates Pin
balaji.t6-Aug-08 1:12
balaji.t6-Aug-08 1:12 
AnswerRe: adding the time component of two dates Pin
Wendelius6-Aug-08 8:24
mentorWendelius6-Aug-08 8:24 
Hi,

There are two questions concerning this:
- what about the date portion. Should the start date be current date (in your example the result goes to next date)
- what are the datatypes for time components, dates, strings?

This SELECT should give you some starting point to adding elements to a date. This returns first day of this month reflected to desired time (variable s) and then added with given time (variable t) and the result is formatted to string to see all the elements:
SELECT TO_CHAR( SYSDATE,    
                'dd.mm.yyyy hh24:mi:ss'    
              ) AS CurrentTime,
       TO_CHAR( TO_DATE('09:00','hh24:mi') -- results in first day of this month at 09:00
                + INTERVAL '19' HOUR       -- adding hours
                + INTERVAL '09' MINUTE,    -- adding minutes
                'dd.mm.yyyy hh24:mi:ss'    -- formatting
       ) AS AddedTime
FROM dual;

And the result:
CURRENTTIME	ADDEDTIME
6.8.2008 21:18	2.8.2008 4:09

Notice that when using only time portion in to_date function, the date is set to the first day of current month.

Mika
QuestionHow to create stored procedure in SQL Server 2005 Pin
compad6-Aug-08 0:19
compad6-Aug-08 0:19 
AnswerRe: How to create stored procedure in SQL Server 2005 Pin
Colin Angus Mackay6-Aug-08 0:57
Colin Angus Mackay6-Aug-08 0:57 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
compad6-Aug-08 22:55
compad6-Aug-08 22:55 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
Colin Angus Mackay6-Aug-08 23:10
Colin Angus Mackay6-Aug-08 23:10 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
compad6-Aug-08 23:14
compad6-Aug-08 23:14 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
nelsonpaixao6-Aug-08 14:34
nelsonpaixao6-Aug-08 14:34 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
compad6-Aug-08 22:56
compad6-Aug-08 22:56 
GeneralRe: How to create stored procedure in SQL Server 2005 Pin
Colin Angus Mackay6-Aug-08 23:10
Colin Angus Mackay6-Aug-08 23:10 
AnswerRe: How to create stored procedure in SQL Server 2005 Pin
new2pgrmg6-Aug-08 22:32
new2pgrmg6-Aug-08 22:32 
QuestionIndexs Pin
janakinandhu5-Aug-08 23:42
janakinandhu5-Aug-08 23:42 
AnswerRe: Indexs Pin
sunil goyalG5-Aug-08 23:52
sunil goyalG5-Aug-08 23:52 
QuestionAll database names query ? Pin
rajg825-Aug-08 22:51
rajg825-Aug-08 22:51 
AnswerRe: All database names query ? Pin
Blue_Boy5-Aug-08 23:26
Blue_Boy5-Aug-08 23:26 
QuestionRequirement on Server Machine and Client Machine Pin
Rupsaa5-Aug-08 21:42
Rupsaa5-Aug-08 21:42 
QuestionSQL Server 200 Pin
waqas_2k5-Aug-08 21:10
waqas_2k5-Aug-08 21:10 
AnswerRe: SQL Server 200 Pin
topcatalpha6-Aug-08 21:32
topcatalpha6-Aug-08 21:32 
QuestionNeed to create tables with different culture Pin
Satish - Developer5-Aug-08 20:04
Satish - Developer5-Aug-08 20:04 

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.