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

[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