Date range parameter with manual SQL
I'm trying to use a date range parmeter (date type with search operator
between) with a manual SQL query but I can't seem to figure out the correct
syntax. If I enter:
SELECT *
FROM Orders
WHERE OrderData BETWEEN :DateRangeParam
I get an error about being unable to convert a type string to type date.
Please advise what the correct syntax for the SQL query should be
Thanks,
Kenny
between) with a manual SQL query but I can't seem to figure out the correct
syntax. If I enter:
SELECT *
FROM Orders
WHERE OrderData BETWEEN :DateRangeParam
I get an error about being unable to convert a type string to type date.
Please advise what the correct syntax for the SQL query should be
Thanks,
Kenny
This discussion has been closed.
Comments
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Not sure if this is related but I'm also encountering problems attempting to
use an InList parameter with a manual SQL query. Given the query:
SELECT *
FROM Customers
WHERE Customer_ID IN :InListParameter
I'm seeing unpredictable results and different result being returned in the
designer and when the query is run for real. The InListParameter is made up
of manual name=value pairs in the LookupList rather than from a query of an
external table.
Thanks,
Kenny
Try updating to RB 11.03 and retest.
RB 11.03 includes fixes to support multi-value search parameters such as
Between and InList. When you define the Parameter, use the
AutoSearchSettings to specify the SearchOperator as soBetween or soInList.
The SearchExpression can contain a comma delimited list of values. The
:InListParameter should work correctly.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com