Plex 2E

  • 1.  Datetime parameter for a Select in Exec sql source code

    Posted Oct 01, 2008 04:49 AM
    I need to create a parameterized query SQL using Exec Sql.In the Where clause I must specify a search for a datetime field.When I write where myDate = &(1:), where &(1:) is represented byanother date field, an error occurs.I'm using Plex 5.5 and SQL Server 2000.Can I solve this issue, indipendently by the language (English or Italian)?Thanks


  • 2.  Re: Datetime parameter for a Select in Exec sql source code
    Best Answer

    Posted Oct 01, 2008 06:11 AM
    Hi pasquale,  For a date field you should have myDate = {d'&(1:)'} in your source code or message.   Likewise for a time field you would have myTime = {t'&(1:)'} and for a timestamp, myTimestamp = {ts'&(1:)'}   (all for MS SQL databases).  Take a look at FOUNDATION/Filter.Filter.BlockFetch which dynamically builds up a where clause for use in a Select Where statement.


  • 3.  Re: Datetime parameter for a Select in Exec sql source code

    Posted Oct 01, 2008 06:53 AM
    I have tried  your suggest  successfully!Does it function for an Exec SQL Update?Thanks


  • 4.  Re: Datetime parameter for a Select in Exec sql source code

    Posted Oct 01, 2008 06:58 AM
    Hi Pasquale,  I have not tried, but I would think so. The {d }, {t } and {ts } are escape sequences which tell the ODBC driver that they need to convert the data between to a format understood by the target database.