question

us2050 avatar image
us2050 asked

How to use Key {Key:pair} passed from Python to SQL server query

Python code -

paramsDict = {'USdateFrom':Rdate.getUSFormatDateOnly(dateFrom,Rdate.MEDIUM),'USdateTo':Rdate.getUSFormatDateOnly(dateTo,Rdate.MEDIUM)}
Rutilities.debug(Rdate.getUSFormatDateOnly(dateFrom,Rdate.MEDIUM))
dao = thisApplication.executeQueryFromDatasource("SQL server query file",paramsDict)

This code calls file which has below sql.

SQL server code - SQL server query file

SELECT * from <Table>

WHERE
CONVERT(VARCHAR,CAST(TABLE_DATE AS DATETIME),101)
BETWEEN
CONVERT(VARCHAR,'USdateFrom',101)
AND
CONVERT(VARCHAR,'USdateTo',101)

Query - USDateFrom and USdateTo in SQL does not work. No error. We use Reliance ETQ Product.

sql serverviewspython
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.