Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread convert a sql Result date format
Thu, Nov 23 2006 8:05 AMPermanent Link

sharma
HI there
Can any one help me to find how to convert a date format on DBISAM please.

I am having a date field call ddcalldate. This is a date field.
According to DBIsam Manual I under stand this is YYYY-MM-DD format.

Select Caller_Number, Caller_Name, Caller_Date
From TblIncomingcall
Where Caller_Date BETWEEN :StartDate AND :EndDate

dbqtblLedger.ParamByName('StartDate').Value   := edtSDate.DateTime;
dbqtblLedger.ParamByName('EndDate').Value    := edtEDate.DateTime;

I am Only using Ttimepicker to get the param value.

I wanted the answer to be posted to TDB Grid

Because of the date format I am not getting any result.

Can any one help me to correct or convert the date routine please
Many thanks for your help in advance.
Sharma
Thu, Nov 23 2006 8:19 AMPermanent Link

"Robert"

"sharma" <sharma@cglloyds.co.uk> wrote in message
news:E16A6EB5-739D-490A-A57D-B75A28BE0711@news.elevatesoft.com...
> HI there
> Can any one help me to find how to convert a date format on DBISAM please.
>
> I am having a date field call ddcalldate. This is a date field.
> According to DBIsam Manual I under stand this is YYYY-MM-DD format.
>

Well, not really. A date field is a float. The YYYY-MM-DD format is what you
use when you use an "explicit" date in SQL, as in

WHERE MyDateFiled = '2006-11-23'

>
> dbqtblLedger.ParamByName('StartDate').Value   := edtSDate.DateTime;

Use just the date portion. edtEDate.Date

Robert


Thu, Nov 23 2006 9:00 AMPermanent Link

sharma
Hi I Tried that before edtEDate.Date still no differents i won't get a result but if i hard code the value for 'StartDate' as 01-08-2006 then it works.

thanks Robert

Thu, Nov 23 2006 9:19 AMPermanent Link

"Robert"

"sharma" <sharma@cglloyds.co.uk> wrote in message
news:6FE98A75-2CD7-4747-89F5-69AF4825AC17@news.elevatesoft.com...
> Hi I Tried that before edtEDate.Date still no differents i won't get a
> result but if i hard code the value for 'StartDate' as 01-08-2006 then it
> works.
>

It has to work WinkIt's the same thing. Make sure you use both the start
date and end date as date, not datetime. Also you should have the parameters
datatype set to date, not datetime.

Robert

Thu, Nov 23 2006 9:42 AMPermanent Link

sharma

if i use This  hard coded then Works  fine

Select Caller_Number, Caller_Name, Caller_Date Total_Due
From TblIncomingcall
WHERE (Caller_Date BETWEEN '2006-01-01' AND '2006-12-31')
-----------------------------------------------------------------------

This doesn’t work
Select Caller_Number, Caller_Name, Caller_Date Total_Due
From TblLedger
Where Caller_Date BETWEEN :StartDate AND :EndDate


This my param search

 dbqtblLedger.ParamByName('StartDate').Value   := edtSDate.Date;
 dbqtblLedger.ParamByName('EndDate').Value    := edtEDate.Date ;


Finally data Selected data type is FtDate
Emmmmm I am not getting any results
i also made sure request live = true


Thu, Nov 23 2006 10:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

sharma


Is it anything to do with the fact that you're talking about different tables?

Roy Lambert
Thu, Nov 23 2006 10:17 AMPermanent Link

sharma
Hi Roy No it is just the same one table
sorry i couldn't understand why this it is starnge
thanks a lot again
Thu, Nov 23 2006 6:42 PMPermanent Link

"Ralf Bertoldi"
sharma wrote:

> Select Caller_Number, Caller_Name, Caller_Date Total_Due
> From TblLedger
> Where Caller_Date BETWEEN :StartDate AND :EndDate
>
>
> This my param search
>  
>   dbqtblLedger.ParamByName('StartDate').Value   := edtSDate.Date;
>   dbqtblLedger.ParamByName('EndDate').Value    := edtEDate.Date ;
>
> Finally data Selected data type is FtDate
> Emmmmm I am not getting any results
> i also made sure request live = true


I would write it like this:

 dbqtblLedger.ParamByName('StartDate').AsDate <<  

... and have a look at the values like this..

 ShowMessage(
 'Startdate '+ quotedstr(engine.DateToAnsiStr(edtSDate.Date))+
 ' / Enddate '+ quotedstr(engine.DateToAnsiStr(edtEDate.Date))
 );

HIH
ralf
Image