Trygve Thayer
asked on
C# code If then else statement for date field.
I am a C# newby with a recently upgraded Epicor software and need some help.
I need some code to put in a query and have no clue how to write it. In the ABL language I was used to it would be something like this
If IsNull(LaborHed.PayrollDat e) then Today
else LaborHed.PayrollDate
In my own words I want to check if a date field is blank or null. If it is blank or null then put in today's date otherwise use the date in the field.
I need some code to put in a query and have no clue how to write it. In the ABL language I was used to it would be something like this
If IsNull(LaborHed.PayrollDat
else LaborHed.PayrollDate
In my own words I want to check if a date field is blank or null. If it is blank or null then put in today's date otherwise use the date in the field.
ASKER
This returns an error message of Possible SQL Injection.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
If type of LaborHed.PayrollDate is DateTime.