Fwd: $431: MS SQL Date fields

Ben Price ben at clintelsystems.com
Tue Aug 26 19:10:34 EDT 2014


Hi List,

I have only just joined the Omnis language again after a 2 year break in 
the solar industry and not sure if my omnisdev-en list is working 
correctly so please be nice while I get back up to speed with the omnis 
list.

I have a problem with Dates.

MS SQL 2008 r2 stores dates in 'y-m-D' format and I need them to be in 
'D-m-y' format

I need this after Statement.$fetch(lList,kfetchall)

The reason I need this is because for some reason I cannot compare dates 
eg llist.date>#D after the fetch with llist.date being in 'y-m-D' format.

UPDATE:

right after

Statement.$fetch(lList,kfetchall)

I have to do:

plist is a row/list field reference
l is a long int
x is a long int
ldate is a datetime, Date Time D m Y

For l from 1 to plist.$colcount() step 1
     If 
plist.$cols.[l].$coltype=kDate&plist.$cols.[l].$colsubtype<>kDatetime
         For x from 1 to plist.$linecount step 1
             If plist.$linecount=1     ;; Its a row so access is different
                 Calculate ldate as jst(plist.[l],'D m y')
                 Calculate plist.[l] as ldate
             Else
                 Calculate ldate as jst(plist.[x].[l],'D m y')
                 Calculate plist.[x].[l] as ldate
             End If
         End For
     End If
End For

which fixed the issue but will be a big performance hit.

There must be some overriding ODBC / session or statement setting for 
getting this right but I can't find it. Anyone with any ideas?

-- 
All the best,

Ben Price









More information about the omnisdev-en mailing list