Joy Conner
24th April 2015, 22:42
how do you write sql statement and include records where a date field is null?
select table.*
from table
where table.date_field = 0
This used to work when running on unix / informix. But today it does not work on windows / sql. ???
mark_h
25th April 2015, 03:04
Joy,
If you don't mind could you post the solution so someone else in the future could find a solution for the problem.
RedBatz
27th April 2015, 12:59
Hi,
the sql statement is executed directly in the database?
If so, try this where clause:
where year(table.date_field)=1753
vahdani
27th April 2015, 14:12
Hi Joy,
latest Porting set versions set an empty date field to January first 1970.
This seems to work:
select table.*
from table
where table.date_field = DATETIME2FROMPARTS (1970,1,1,0,0,0,0,0);
mark_h
4th May 2015, 03:51
Joy - can you post the solution for someone in the future. Maybe the two answers above are correct, but it might help someone in the future.
patvdv
4th May 2015, 21:14
Please do not delete threads where other members have contributed to a potential solution.
Joy Conner
4th May 2015, 23:05
Sooo sorry. Delete thread was an option that appeared to work. The solution to the problem was to fix a syntax error.
The execution was not done directly on the database.
My porting set is more current than 1970. The info is interesting but NA.
I apologize for causing an inconvenience. I deleted post the date I posted when I realized I asked a question too hastily.
patvdv
5th May 2015, 07:57
Sooo sorry. Delete thread was an option that appeared to work. The solution to the problem was to fix a syntax error.
The execution was not done directly on the database.
My porting set is more current than 1970. The info is interesting but NA.
I apologize for causing an inconvenience. I deleted post the date I posted when I realized I asked a question too hastily.
Hi Joy,
No worries. Deletion of threads is not prohibited but sharing knowledge is the ultimate goal even if the question was too hastily asked. Some of the replies may still be of value to other board users :)