[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Sysdate



I assume the problem you're having is caused by the timestamp after the
date?  If so, try this:

where trunc(a.audit_stamp) = trunc(SYSDATE)

The "trunc" function truncates the timestamp from the date.

Mrs. Penny M. Ginn
Associate Director of Information Technology
Presbyterian College
Clinton, SC  29325   864-833-8212



-----Original Message-----
From: sqr-users-bounces+pmginn=presby.edu@sqrug.org
[mailto:sqr-users-bounces+pmginn=presby.edu@sqrug.org]On Behalf Of
radhika reddy
Sent: Tuesday, September 13, 2005 10:04 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Sysdate


Hi,

   I am trying to retrieve rows which are equal to sysdate. The date field
stored on ps_audit_addresses is in the format of date time(9/13/2005 8:45:33
AM). By doing the following I am able to achieve it. But, i am wondering is
there any other way where instead of getting all the rows from
PS_AUDIT_ADDRESSES and then checking whether Audit Stamp is equal to
SYSDATE?
See, i tried using SUBSTR in sql but it didn't work.


begin-select
a.emplid,
a.audit_stamp &timestamp

   display $sysdatetime            !here i get 13-SEP-2005_09:50:49_AM

   let $sysdate1 = substr($sysdatetime,1,11)
   #debugH show $sysdate1                               !13-SEP-2005

   show 'timestamp:' &timestamp                         !13-SEP-2005

  If $auditimestamp = $sysdate1
     show 'transaction on that date'                      !both are equal
  else
     show 'no transactions'
  end-if

from ps_audit_addresses a
!where substr(a.audit_stamp,1,11) = SYSDATE
END-SELECT

Thanks,
Radhika

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


_______________________________________________
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