0
I have the following situation, I need to check if the time of a given task is no longer filled in the system and for this by performing an SQL command in SQL Server 2014 works, as in the example
Select (cast((convert(datetime,hora,108)) +'00:01:00.000' as time(7))) as tempo from MIGRACOES_INTE_HORA
OBS: I perform the Convert to transform the time of Varchar
for team...
but in the system I use the filter property of a TFDQuery
to perform the query, more to optimize the same.
in the added filter
(CAST((convert(datetime,'+TimeToStr(dtpInteHora.Time)+',108)) + '00:01:00.000', as time(7)) = '+DateToStr(qryInteHora.FieldByName('Hora').AsDateTime)+') or
(CAST((convert(datetime,'+TimeToStr(dtpInteHora.Time)+',108)) - '00:01:00.000', as time(7)) = '+DateToStr(qryInteHora.FieldByName('Hora').AsDateTime)+')
but when active the filter comes the following error
[FireDAC][Stan][Eval]-100. Column or function [CAST] is not found. Hint: if the name is a function name, then add FireDAC.Stan.ExprFuncs to uses clause.
Would someone like to tell me how to make this filter??
yes filter is applied to already loaded records, only I need to perform a date validation and I can’t use the cast, Convert and other SQL functions in the filter... To solve this problem I had to put another query pulling the records with the necessary expression. Thank you for the answer...
– Leaonardo Maciel