Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Date in Autosearch with Pervasive.SQL as BackEnd

edited March 2005 in End User
hi

i am using Rbuilder as an EXE. to build reports. I use Pervasive.SQL Version
8(www.pervasive.com also known as Btrieve) as the backend via ODBC. the
Rbuilder.exe version i am not sure. But it is the designer version because i
get to se the Calc Tab.

Now the question is when in the Auotsearch i enter the date it says invalid
date or timestamp.

When i check the SQL statement on the SQL tab which the Query is sending it
is as follows
........
.......
where(orderheader."Date"='05/21/2005")

where as the date storage type in Pervasive.SQL is YYMD so the date is
stored as 2005-05-21.

So the Query should be sent as "date"='2005-05-21'

How do i to that so that the Report can be viewed as per this date format.
any help would be most appreciated.

regards
Sunjay

Comments

  • edited March 2005
    Hi Sunjay,

    -------------------------------------------------
    Tech Tip: Date formats used by DADE
    -------------------------------------------------

    DADE handles in two phases:


    1. User entry

    This occurs when the user specifies a date using the Query tools or the
    AutoSearch dialog. DADE converts the date string entered by the user into a
    Delphi TDateTime value. The string entered by the user is converted using
    Delphi's StrToDateTime. By default Delphi's StrToDateTime relies on the date
    formatting variables for the current windows locale. These can be overridden
    by the developer. See Delphi online help for StrToDateTime for more
    information.


    2. SQL submitted to the server

    When generating the SQL to be submitted to the database server, DADE
    converts the TDateTime value from number 1 above, to a string using the
    Delphi's FormatDateTime function. The format string used to convert the
    TDateTime is specified by the TdaSession.GetSearchCriteriaDateFormat and
    TdaSession.GetSearchCriteriaTimeFormat functions. These are virtual methods
    which may be overridden by descendant TdaSession classes.

    Below are the default values returned.


    {------------------------------------------------------------------------------}
    { TdaSession.GetSearchCriteriaDateFormat }

    function TdaSession.GetSearchCriteriaDateFormat(aDatabaseType:
    TppDatabaseType; const aDatabaseName: String): String;
    begin

    {return a format usable by FormatDate}
    case aDatabaseType of

    dtMSAccess:
    Result := 'YYYY-MM-DD';

    dtMSSQLServer, dtSybaseASA, dtSybaseASE, dtOracle:
    Result := 'YYYY/MM/DD';

    dtAdvantage:
    Result := 'YYYY-MM-DD';

    else
    Result := 'MM/DD/YYYY';

    end;

    end; {function, GetSearchCriteriaDateFormat}

    {------------------------------------------------------------------------------}
    { TdaSession.GetSearchCriteriaTimeFormat }

    function TdaSession.GetSearchCriteriaTimeFormat(aDatabaseType:
    TppDatabaseType; const aDatabaseName: String): String;
    begin
    {return a format usable by FormatDateTime}
    case aDatabaseType of

    dtMSAccess:
    Result := 'HH::MM::SS';

    else
    Result := 'HH:MM:SS';
    end;

    end; {function, GetSearchCriteriaTimeFormat}



    Note: DADE augments the above with additional formatting delimiters for
    Oracle and MSAccess. See TdaSQL.ResolveCriteria located in
    RBuilder\Source\daSQL.pas for more information.


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2005
    Hi Nico

    First thanks for the very quick response.

    Firstly we dont Use Delhpi to build applictions. But yes we do use the
    Reportbuilder to build reports. we Had tested quite a few even CR which
    seems to be the defacto standard for Reporting.


    But me i personally found RB way ahead of CR. it really blows away CR. We
    have been Building Business Apps for nearly 10 year now and we were
    wondering how come we had never heard of RB.It is just amazing what you can
    do with it even without touching RAP. I have just started using RB, so you
    would have to bear with me for sometime.

    Personally i dont think i need to know Delphi or use Delphi to use RB. But
    i would like to know how do i use the Power of RB to build my reports.

    So at this time i am stuck because of the Date problem. It would be nice if
    i could be shown the way as to how to code it .

    Also as a suggestion it would be nice if the tutorials and examples of RB be
    made available for a End users who are not using Delphi as their Language of
    Choice for Development.

    Hoping to solve my problems and move forward with implemeting my solution.

    Thanks
    Regards
    Sunjay


    ----- Original Message -----
  • edited March 2005

    The Designer.DataSettings.DatabaseType and Designer.DataSettings.SQLType
    control the syntax of the SQL that is generated. There is not currently a
    DatabaseType setting for Pervasive. However, one of the other settings might
    work - many database products are similar.

    Please note that we currently only sell and support our products to Delphi
    Developers. If you are end-user using RB embedded in another product, then
    you need to rely upon the publishers of that software for tech support.

    Thanks for your positive feedback about ReportBuilder :)

    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2005
    Hi Nard

    I do understand that you would not support if the product is not bought from
    Digital Metaphor.

    I bought this product as a stand alone Report Writing tool from a Person
    from Bosina, after a long search over the internet. Now the Publisher is
    vanished and i am left staning all alone. And again after a long search i
    found out that Digital Metaphors are the orignial makers.

    So would you support it for a fee or do you have any seprate division which
    does this. Or could you direct me to some one who could do it or a does a
    end user Usergroup exists to ask for help.

    I would be grateful because i am not giving up this up as yet. It is a
    temporary blip thats all.

    So pleaseeee help me

    Thanks
    Sunjay

  • edited April 2005

    1. It is against our license for anyone to use ReportBuilder to build a
    stand alone reporting tool. Sounds like you have an illegal product.

    2. Sorry, we currently sell to and support Delphi developers.This may change
    in the future, however, for now that is the only sales and service that we
    offer.


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.