Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SYSDATE in Sql vba Recordset error

hi all...first post...I am having difficulty creating a recordset
using sysdate. I am trying to gather data only from 'today' using a
macro. However, when I run my sql, I continue getting a error. When I
just enter a specific date into the code it works fine. Code
below...if anyone could help. Thanks

SQL = " SELECT "
SQL = SQL & "
SECURITY_TRANSACTION.SETTLEMENT_TRANSACTION_DATE,"
SQL = SQL & " trunc(SECURITY_TRANSACTION.TRADE_PLACED_TIME) ,"
SQL = SQL & " XXX_BROKER_1.ORGANIZATION_NAME Clear,"
SQL = SQL & " SECURITY_MASTER.COUNTRY_VALUATION_CODE,"
SQL = SQL & " SECURITY_MASTER.CURRENCY_ISSUE_CODE,"
SQL = SQL & " SECURITY_TRANSACTION.FORWARD_RATE_AMT"
SQL = SQL & " FROM"
SQL = SQL & " SR_BASKET BASKET,"
SQL = SQL & " SR_CUSTODIAN CUSTODIAN,"
SQL = SQL & " SR_SECURITY_MASTER SECURITY_MASTER,"
SQL = SQL & " SR_SECURITY_TRANSACTION SECURITY_TRANSACTION,"
SQL = SQL & " WHERE"
SQL = SQL & " AND SECURITY_MASTER.TYPE_SECURITY_CODE='CFWD'"
SQL = SQL & " AND TRUNC(SECURITY_TRANSACTION.CREATION_DATE) =
TRUNC(SYSDATE)"
SQL = SQL & " AND
SECURITY_TRANSACTION.TYPE_CORPORATE_ACTION_CODE Is Null"
SQL = SQL & " AND SECURITY_TRANSACTION.TRADE_STATUS_CODE<'C'"
SQL = SQL & " AND TICKET.VERSION_CURRENT_FLAG='Y'"
SQL = SQL & " ORDER BY
SECURITY_TRANSACTION.SETTLEMENT_TRANSACTION_DATE"

Set rs_entry = db.OpenRecordset(SQL, dbOpenSnapshot,
dbSQLPassThrough)
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing a recordset error : Operation is not allowed when...is clo NateBuckley Excel Programming 3 May 20th 08 01:06 PM
Error 1004 Recordset - Help ina Excel Programming 6 May 17th 06 06:15 PM
Error opening recordset where table is empty (but has field names) - How do I avoid? Alan Excel Programming 1 October 10th 05 07:43 AM
Error when opening recordset of SQL Server via ADO Glenn Ray[_3_] Excel Programming 0 September 2nd 05 11:00 PM
ADO recordset error mkarja Excel Programming 2 February 14th 05 12:22 PM


All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"