Title: hijri query sql server                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
SELECT     TA_UserID, CONVERT(nvarchar(11), TA_LocalTimestamp, 105) AS dates, CONVERT(nvarchar(11), TA_LocalTimestamp, 131) AS hijri, DATENAME(WEEKDAY, 
                      TA_LocalTimestamp) AS myday, MIN(CASE WHEN TA_IDContext = 100 THEN substring(CONVERT(VARCHAR, TA_LocalTimestamp, 114), 1, 5) END) AS min_in, 
                      MAX(CASE WHEN TA_IDContext = 200 THEN substring(CONVERT(VARCHAR, TA_LocalTimestamp, 114), 1, 5) END) AS max_out
FROM         TBST_TARecords
WHERE     (TA_LocalTimestamp >= CONVERT(datetime, `24-05-1437`, 131)) AND (TA_LocalTimestamp < CONVERT(datetime, `01-06-1437`, 131) + 1) AND (TA_UserID = `321`)
GROUP BY TA_UserID, CONVERT(nvarchar(11), TA_LocalTimestamp, 105), CONVERT(nvarchar(10), TA_LocalTimestamp, 105), CONVERT(nvarchar(11), TA_LocalTimestamp, 
                      131), DATENAME(WEEKDAY, TA_LocalTimestamp)
ORDER BY CONVERT(nvarchar(10), TA_LocalTimestamp, 105) DESC