Greetings,
I'm not sure which calendar object you are using so I can can't say for
sure, but I suggest taking a look at the default property for the
object. It would be silly (though possible) that it's not returning the
date as the default property.
Another possibility is the formatting of the date in the query. It's
been a while since I used Oracle so I don't remember what it is but not
all databases like dates wrapped with '.
Corin
aneurin wrote:
> hi i have the below code that connects to an oracle database
> what i want it to do is the user selects the date required on a
> calender object types in a number in the a text box and press a
> button it then should the carry out the query
> it works fine if i have sysdate- 1 in the code
> but when i use the caleder it does not work
> does any one have any ideas
>
>
> Private Sub Command2_Click()
>
> Dim db As Connection
> Dim txtsql As String
>
> Set db = New Connection
> db.CursorLocation = adUseClient
> db.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User
> ID=rep;password=rep;Data Source=live;"
>
> Set adoPrimaryRS = New Recordset
> txtsql = "select MOMENT,CAMPAIGN,STARTED from CAMPAIGN_SUMMARY WHERE
> TRUNC(CAMPAIGN_SUMMARY.MOMENT)= " & "'" & cale1 & "'" & " and
> GAS_CAMPAIGN_SUMMARY.WEEK = " & "'" & txtbox & "'" & ""
> adoPrimaryRS.Open txtsql, db, adOpenStatic, adLockOptimistic
>
>
> Set grdDataGrid.DataSource = adoPrimaryRS
> lblStartedval(0).Caption = "" & adoPrimaryRS.Fields("started").Value
> mbDataChanged = False
> End Sub<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: connect to database using calender value in query