|
-
Sep 15th, 2000, 08:36 AM
#1
Thread Starter
Addicted Member
Hiya everybody
I'm having a bit of trouble with an SQL statement and I wondered if anyone knew where I was Going wrong. I want to extract data from a table. The user can specify dates between which the data will be displayed.
The user inputs the start and end dates which are place into the variables 'Starter' and 'Ender'.
When I try to run the search I get the following error message:
"Missing right parenthesis"
Heres my SQL Statemet ( it is one long line ):
cmmSQL = "SELECT StartDateTime, EndDateTime, DurationSecs, CallersNumber, DialledNumber,TerminatingNumber, ValuePence
FROM Opal_Data
WHERE TerminatingNumber = '" & PRSselecta & "'
AND
StartDateTime >=TODATE(" & Starter & ",DD/MM/YYYY HH:MM:SS)
AND
EndDateTime <=TODATE(" & Ender & ", DD/MM/YYYY HH:MM:SS) "
Set rsCDR = cnAcqAcc.Execute(cmmSQL)
rsCDR.MoveFirst
Any Help appreciated!
Cheers 'n' Beers
Skeen
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Sep 15th, 2000, 09:03 AM
#2
Fanatic Member
Hi Skeen, What database is this coming from ?
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Sep 15th, 2000, 09:13 AM
#3
Thread Starter
Addicted Member
Hi Ian
I'm running Oracle 8i
Cheers 'n' beers
Skeen
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Sep 15th, 2000, 09:25 AM
#4
Fanatic Member
I'm sorry mate but I've nether used Oracle SQL before (unfortunatley it is different from SQL Server)
but in SQL server, the equivelent of TODATE(" & Starter & ",DD/MM/YYYY HH:MM:SS), the DD/MM/YYYY HH:MM:SS part need's to be in quotes. If it doesn't in Oracle then i'm sorry I cant help.
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|