Subject Re: [IBO] Dynamic SQL
Author peter@cyionics.com
Hi Helen

The status_changed field is a Firebird Timestamp , so it has both date and time info in it. e.g. 29/10/2003 19:58:41
The other date field can be of any data type as it will be entered via a user dialogue.

I assumed obviously wrongly that I had to convert a Timestamp field to a Date and that the user input had to be of the same Date type to perform the comparison.
I was then going to modify the WHERE SQL.
I also plan to limit the number amount of data return, probably <500 records.

What I was trying to achieve was a simple master detail sales report between two dates.

Rgds

Peter


----- Original Message -----
From: Helen Borrie
To: IBObjects@yahoogroups.com
Sent: Sunday, November 09, 2003 11:49 AM
Subject: Re: [IBO] Dynamic SQL


At 11:21 AM 9/11/2003 +0000, you wrote:
>Hi
>
>I am about to write a report module for a customer in delphi5 using an
>TIB_Query and FastReport
>
>The generic SQL will be as below , with the search date criteria set by
>the user.
>
>select id from pins
>where Cast(status_changed as Date) >= Cast('5-Nov-2003' as Date) and
>Cast(status_changed as Date) <= Cast('15-Nov-2003' as Date)
>
>
>Obviously I can build this SQL statement up in my program and set the SQL
>property without any problems.
>
>I don't think however this is the best way to do it in Ibobjects.

It's not the best way to do it in database!! Why are you casting
status_changed?

>Can anyone recommend a better way ?

I hope so. Please provide more info about these data types.

Helen



Yahoo! Groups Sponsor



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


[Non-text portions of this message have been removed]