>Is this the right way to do or is there a better way ?

In addition to the comments others have made, I would suggest you use:

'select count(*) from tx where VehicleID = ' + QuotedStr(VehicleID)

'count(*)' is a special case for the count function that returns "count of
records".

In terms of performance, this will have no measurable benefit with SQLite.
However other database's can often return results substantially quicker
(particularly when there is no 'where' clause) than using 'count(<column
name>)'.

Regards
Nick


********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Reply via email to