Subject Re: [firebird-support] Simple SELECT statement not working Firebird-2.5.0.26083-0_Win32
Author Helen Borrie
At 06:36 AM 16/09/2010, RDS wrote:
>1. I'm using Firebird-2.5.0.26083-0_Win32 on Windows 7 OS.
>2. For an existing record in table a PATIENTCHARGESDUES, the under mentioned select statement does not returns the exisiting record when i uncomment the line that compares field ENTRYTIME even on copy paste the field value. Rest all fields work fine. I've tried removing zeros event ie '15.9.2010, 20:40:06.674'
select * from PATIENTCHARGESDUES p where
p.SERVICEID='2300094' and
p.AMOUNT=2000 and
p.AMOUNT_BEFORE_DISCOUNT = 2000 and
p.HOSPSRVCDESC='OUT PATIENT' and
p.REMARKS='1x1800. ' and
p.DATEOFEXPENSE = '15.9.2010, 20:20:14.8230'
*** 1 ***
and
p.ENTEREDBY = 'HISADMIN' and
p.ENTRYPC = 'NannuPC'

/*and
p.ENTRYTIME='15.09.2010, 20:40:06.674'
*** 2****
*** 3 ***
p.REGDID=:REGDID and
p.RECEIPTANTID=:RECEIPTANTID;*/
*** 4 ***

1 and 2 : comma is not valid in a date literal. Separate the date and time parts with a single blank. However, if you didn't get an exception from these literals then possibly the parser has been taught to ignore the extraneous comma....don't know....best to provide known-to-be-valid literals, however.

3. Missing AND

4. The query will not return any results if you don't supply values for parameters. Your driver interface should prepare the statement on the initial request and then pass one or more subsequent requests that supply the parameters.

./heLen