Closed imnileshd closed 1 year ago
I managed to get the required output
from pypika import Query, Table
from pypika import CustomFunction
from pypika.terms import PseudoColumn
table = Table('table')
convert = CustomFunction('CONVERT', ['date', 'date_column'])
query = Query.from_(table) \
.select('*') \
.where(convert(PseudoColumn('date'), table.ProcessDate) == '2022-11-22')
print(query)
Output SELECT * FROM "table" WHERE CONVERT(date,"ProcessDate")='2022-11-22'
Thanks
How do I build like this?
SELECT * FROM table WHERE CONVERT(date, ProcessDate)='2022-11-22'