var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: update a field
I have a field in a table that I have to update to the number of the week.
Information i use is from another field, which is text in the format like :
How to write an update to update empty field with a number of the week based on the value from another field.
Thank you very much.
What do you mean by "number of the week"? Do you mean 1/1/2006 is in week #1 of the year, or do you mean 1/3/2006 is day #3 of the week?
In either case, you should be able to use the DatePart function to get what you need.
Hope this helps.
Yes, the 1/1/2006 is the week #1 and so on.
but I need this for the year 2005 where the week number 1
is from Dec 26, 2004 to Jan 1, 2005
SELECT DatePart(wk, Stuff(Stuff(d, 5, 0, '/'), 3, 0, '/'))
FROM (SELECT '01022005' AS d UNION ALL
SELECT '02142005' UNION ALL
SELECT '07082005' UNION ALL
SELECT '11222005' UNION ALL
SELECT '12022005') AS z