Quantcast
Channel: Getting started with SQL Server forum
Viewing all articles
Browse latest Browse all 9243

help with error

$
0
0

can some help me with this error

tmp-mksh: <stdin>[1]: syntax error: '(' unexpected

from this query

SELECT start || ' ' || title || '\n' || (CASE WHEN allDay = 1 THEN 'All day' ELSE (CASE WHEN (cast(strftime('%H', starttime) AS integer) > 12) THEN ((strftime('%H', starttime) - 12) || strftime(':%M', starttime) || 'PM') WHEN (cast(strftime('%H', starttime) AS integer) = 12) THEN ('12:' || strftime('%M', starttime) || 'PM') WHEN (cast(strftime('%H', starttime) AS integer) = 0) THEN ('12:' || strftime('%M', starttime) || 'AM') ELSE ((strftime('%H', starttime) + 0) || strftime(':%M', starttime) || 'AM') END) || '-' || (CASE WHEN (cast(strftime('%H', endtime) AS integer) > 12) THEN ((strftime('%H', endtime) - 12) || strftime(':%M', endtime) || 'PM') WHEN (cast(strftime('%H', endtime) AS integer) = 12) THEN ('12:' || strftime('%M', endtime) || 'PM') WHEN (cast(strftime('%H', endtime) AS integer) = 0) THEN ('12:' || strftime('%M', endtime) || 'AM') ELSE ((strftime('%H', endtime) + 0) || strftime(':%M', endtime) || 'AM') END) END) || ' | ' || eventLocation FROM (SELECT date(Instances.startDay) AS start, date(Instances.endDay) AS end, eventLocation, time(Instances.startMinute * 60, 'unixepoch') AS starttime, time(Instances.endMinute * 60, 'unixepoch') AS endtime, Calendars.calendar_displayName, Events.title, Events.allDay FROM Calendars JOIN Events ON Calendars._id = Events.calendar_id JOIN Instances ON Instances.event_id = Events._id WHERE (strftime('%s', date(Instances.startDay)) < strftime('%s', date('now'), 'localtime', '+5 days')) AND (((strftime('%s', (date(Instances.endDay))) >= strftime('%s', date('now'), 'localtime'))) OR (allDay = 1 AND strftime('%s', date(Instances.endDay)) > strftime('%s', date('now'), 'localtime') AND strftime('%s', date(Instances.startDay)) < strftime('%s', date('now'), 'localtime', '+1 days'))) AND Calendars.calendar_displayName IN ('CALENDAR NAME 1', 'CALENDAR NAME 2') ORDER BY startDay ASC, starttime ASC, endtime ASC);


Viewing all articles
Browse latest Browse all 9243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>