select right('00' + convert(varchar(2), <insert number here>), 2)
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
Can anybody help me a step further now. I have a date record with date_ts, year_id, month_id, quarter_id, week_id. Month_id, quarter_id and week_id are unique keys that start with value 1 from Jan 1st 1900. Year_Id is 1900, 1901 .. 2006. Any way to create
- week of year (values 1-53)
- week of month (values 1-5)
- week of quarter (values 1-13)
through a regular sql command ?
Ok the solution that I posted works for today and will work fro the week. However it is wrong for a date of 6/1/2005
I will get back to you with a solution
How about if I want to convert a Char into Int. I have a char value '012345' that I need to insert into int Filed. I need to insert whole value without getting rid of 0.How do I do that then??
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.