so either write a function in the front end
or consider using the modulo operator (%) on the DAY of the specified date
eg
Code:
SELECT my, column, list, (DAY(adatecolumn)+6)%7 AS weekno FROM mytable
you may need to tinker with the expression to make certain it meets your requirements
mind you to me its an odd definition of the week number, but its your app