Jag har fått ett fel där mysql börjar att räkna veckan från söndag, frågar man mysql med SELECT WEEK('2006-09-03'); så får man i retur 36, men det ska ju vara 35, någon som vet hur man kan ställa in detta?
Mysql problem, veckan börjar på söndag?
3 svar · 654 visningar · startad av sailsoft
manualen @ mysql.com skrev:
WEEK(date[,mode])
This function returns the week number for date. The two-argument form of WEEK() allows you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range from 0 to 53 or from 1 to 53. If the mode argument is omitted, the value of the default_week_format system variable is used. See Section 5.2.2, “Server System Variables”.
The following table describes how the mode argument works. ...
Finns flera modes där sen ... testa med ex
SELECT WEEK('2006-09-03', 7);
.. vilket ger 35
MySQL 5.0 Reference Manual :: 12.5 Date and Time Functions
/red spango hann visst före...
aha...tack :-)