I am trying to pull the work period start date for a script.
Am using;
SELECT TOP 1 [StartDate]
FROM [WorkPeriods]
ORDER BY [StartDate] DESC
and
var wpStartDateQry = "@@WPStartDate";
var wpstartDateRaw = sql.Query(wpStartDateQry).First;
returns;
24/12/2015 12:23:16
But the value in the database is
2015-12-24 12:23:16.973
The format returned by the query is giving me great difficulty as is in wrong format to put into SQL query later in the script.
.getDate() etc doesnt work on it
Ok, system time solved it but script doesn’t seem to like the time part now!! If manually put yyyy-MM-dd on its own it works but with time I get an error!
126 represents ISO8601 format.
121 does the same thing without the T in the middle.
But having the T can be useful when you use something like this in JS:
var dt = variable.split('T');
echo dt[0]; // print the Date
echo dt[1]; // print the Time
echo dt[0] + ' ' + dt[1]; // print Date/Time with space separating them
Am still struggling to get it to work, cant just use date encase there is a past midnight sale from day before…
Workperiod ID would be nice in ticket table LOL
Get an exception error…
Tried @QMcKay format and split script
Get 2016-01-02 19:15:35.583
but with t.[Date] > '@3'
Where @3 is the parameter/value input and t. is the Tickets table, to the SQL script throws an error.
If i use '2016-01-02 19:15:35.583' I still get an error so something wrong somewhere…
Thats the format in the table…
Thanks Q, have had a bit of a drawback so am having to restructure the scripts as negated to take order tags and gift/void order states into account ass order price is still recorded in full and reported seperatly