• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

comparing Time with a Null value

please correct this please

DataModule1.table_DTR.filter := '(Employee_ID = '+employee_ID+') and '+'(isOVERTIME = FALSE) and '+'(ShiftCode = '+ShiftCode+') and '+'(Time_In <> '+null+') and (Time_Out ='+null+')';

DataModule1.table_DTR.Filtered:=true;




this will result an error, returning that time_in and Time_out will not accept a "null" value. how can i compare those time_in and Out with the value "empty" or no value at all, and identifying if that Time_in or Time_out is empty or not.



0
ryan_sabarre
Asked:
ryan_sabarre
  • 3
1 Solution
 
ryan_sabarreAuthor Commented:
anybody can help me please
0
 
ryan_sabarreAuthor Commented:
or using this function

DataModule1.table_DTR.Locate('Employee_ID;isOVERTIME;ShiftCode;Time_Out', VarArrayOf([employee_ID, FALSE, ShiftCode,not null]), []);

i want locate time_out having any value.

0
 
lortegaCommented:
Try

table_DTR.FieldByName('Time_Out').Required := False;
table_DTR.FieldByName('Time_In').Required := False;

before set the Filtered to true



Luis
0
 
kretzschmarCommented:
+'(Time_In is not null) and (Time_Out is null)';

meikl ;-)
0
 
ryan_sabarreAuthor Commented:
thank you so much
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now