[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Adding minutes to date time field
- Subject: RE: [sqr-users] Adding minutes to date time field
- From: "Knapp, Richard" <KnappR@umsystem.edu>
- Date: Fri, 26 Mar 2004 10:48:38 -0600
- Delivery-date: Fri, 26 Mar 2004 11:49:58 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- Thread-index: AcQTTvAXmMPG7VcBQyOPCzzlY6ONHAAAx1Aw
- Thread-topic: [sqr-users] Adding minutes to date time field
In the SQR documentation under the let command you will find descriptions of
the SQR functions. These include date functions.
Richard Knapp
Database Programmer/Analyst
Institutional Research and Planning
University of Missouri System
573-882-8856
knappr@umsystem.edu
-----Original Message-----
From: sqr-users-bounces+knappr=umsystem.edu@sqrug.org
[mailto:sqr-users-bounces+knappr=umsystem.edu@sqrug.org]On Behalf Of
abhay sachar
Sent: Friday, March 26, 2004 10:22 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Adding minutes to date time field
Hi,
I am selecting two fields from a table, Start Time and Stop Time.
I have to add a logic that if Start Time has a value and Stop Time is null,
then I need to add 15 min. to the Start Time and load that calue in Stop
Time.
Then, I need to insert these 2 values into another table.
I am trying to do this
SELECT
to_char(a.strt_time, 'MM/DD/YYYY HH:MI:SS AM') &a.strt_time
to_char(a.stop_time, 'MM/DD/YYYY HH:MI:SS AM') &a.stop_time
Let $StrtTime = &a.strt_time
Let $StopTime = &a.stop_time
from TABLE1.
Then,
Let $StopTime = dateadd(strtodate($StrtTime),'MINUTE',15)
Then,
INSERT INTO TABLE2 (start_time, stop_time) values (to_date($StrtTime,
'MM/DD/YYYY HH:MI:SS AM'), to_date($StrtTime, 'MM/DD/YYYY HH:MI:SS AM')).
Data is like
Start Tme = 10/02/2003 8:00 AM
But it is not able to insert the 'converted' Stop Time since the conversion
makes it like '02-Oct-2003'. There is no time value in that.
Any help would be greatly appreciated.
Thanks,
Abhay Sachar.
202-334-4381 (Work)
_________________________________________________________________
Apply for a Citibank Suvidha Account. http://go.msnserver.com/IN/45533.asp
Get FREE organiser.
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users