SQLite Functions
Posted: Fri 11 May 2012 02:10
Hi all,
I have leaped into UniDAC and have achieved basic reading and writing from a SQLite db.
I now want to do some date calculations.
In the help file I see there is a group of Date functions, i.e. DATEADD and DATEDIFF.
I am not able to work out how to use them.
This is my SQL in a TUniQuery.
On clicking the OK button after entering the SQL I receive this error:
Unknown function: DATEDIFF.
Do I have to load this function some how? Or is this not available with the SQLite side of UniDAC.
If I have this all wrong, may I have some sample code?
Thanks in advance.
I have leaped into UniDAC and have achieved basic reading and writing from a SQLite db.
I now want to do some date calculations.
In the help file I see there is a group of Date functions, i.e. DATEADD and DATEDIFF.
I am not able to work out how to use them.
This is my SQL in a TUniQuery.
Code: Select all
WHEN tblRecords.StartTime >= :FirstDT THEN tblRecords.StartTime
END AS ST,
CASE
WHEN tblEndTimes.EndTime > :LastDT THEN :LastDT
WHEN tblEndTimes.EndTime <= :LastDT THEN tblEndTimes.EndTime
END AS ET,
tblRecords.ActId,
{fn DATEDIFF (hour, ST, ET)} AS Hrs
FROM tblRecords, tblEndTimes
WHERE (tblRecords.RId = tblEndTimes.RId) AND
((tblRecords.StartTime >= :MinDT) AND (tblEndTimes.EndTime <= :MaxDT))
ORDER BY tblRecords.StartTime;Unknown function: DATEDIFF.
Do I have to load this function some how? Or is this not available with the SQLite side of UniDAC.
If I have this all wrong, may I have some sample code?
Thanks in advance.