>Applications using other APIs, or Transact-SQL scripts, stored procedures, >and triggers should use the unseparated numeric strings for example: >yyyymmdd as 19980924 >I have built this function later on last night after I posted this message. I use it in a method which has to generate a SQL which could fit either VFP or client server table.
* Return a date in a universal format * expD1 Date * expL1 Pass .T. when generating for a backend FUNCTION DateUniversal PARAMETERS tdDate,tlBackend LOCAL lcDate lcDate='' * Client server IF tlBackend lcDate=lcDate+"'" lcDate=lcDate+ALLTRIM(STR(MONTH(tdDate)))+'/'+PADL(DAY(tdDate),2,'0')+'/'+PADL(DAY(tdDate),2,'0') ELSE lcDate=lcDate+'{^' lcDate=lcDate+ALLTRIM(STR(YEAR(tdDate)))+'/'+PADL(MONTH(tdDate),2,'0')+'/'+PADL(DAY(tdDate),2,'0') ENDIF * If we have a date time IF TYPE('tdDate')='T' lcDate=lcDate+' '+PADL(HOUR(tdDate),2,'0')+':'+PADL(MINUTE(tdDate),2,'0')+':'+PADL(SEC(tdDate),2,'0') ENDIF * Client server IF tlBackend lcDate=lcDate+"'" ELSE lcDate=lcDate+'}' ENDIF RETURN lcDateIs there more consideration I need to verify for?