On Friday, May 13, 2011 07:33:30 am Adrian Klaver wrote:
> Have Postgres return a dummy date whenever there is a NULL
Yes I thought of that too. However, there is about 500 lines of code that is
depending on the Null being present (the routine was depending on Postgres
data at the start). So then set the data with '1900-01-01'::date and then
update the dataset with null where field = '1900-01-01' but that did not work.
That was late yesterday - I may have done something wrong.
This is what I came up with and it works.
1. Do all the changes required to the dataset.
2. loop through the dataset
3. change the field data
4. save the record into a list
5. convert the list to a dataset
date_list = ('rereferred', 'datepaid','nxt_class','terminated',
'completed','ret_to_court', 'hold_until', 'mustenrollby', 'me_ltr_sent',
'enrolled','referred date')
ret_ds = []
for rec in d3: # d3 is a dataset
for item in date_list:
rec[item] = fixsqlitedate(rec[item])
ret_ds.append(rec)
newds_ordered = dDataSet(ret_ds)
Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]