[Migrated content. Thread originally posted on 15 March 2012]
Hi, i want to select just the date element of a timestamp columm. Does anyone knowwhat the common syntax / odbc escape sequence is (if there is any) that would enable me to use a single statement
that would work for both Sqlserver & Oracle without having to resort to the type of statement shown below ? Does anyone know if there is a webpage/document anywhere that lists techniques for making embedded sql more database agnostic ?:-
IF SQLSERVER
EXEC SQL
SELECT CONVERT(CHAR(8),NAMEDATE,112) INTO :H-DATETIME
FROM NCHARDATA
WHERE NAMEVAL = :H0286-NAME
END-EXEC
ELSE
EXEC SQL
SELECT TO_CHAR(NAMEDATE,'YYYYMMDD') INTO :H-DATETIME
FROM NCHARDATA
WHERE NAMEVAL = :H0286-NAME
END-EXEC
END-IF
Any advice would be much appreciated, thanks (i'm using Netexpress 5.104.0083)