Microsoft
Software
Hardware
Network
Question : using cast and case...
hi
I am using the following statement.....
select 11,t.MonthId, (case when cast(right(monthid,2)as int)<4 then cast(left(monthid,4)as int)-1
end)
from #MonthRollup t
where t.TimeType=1
and cast(left(monthid,4)as int)>2004
order by 2
The statement give me the result
11, 2005,2004
but I want add 01 on to the end of the 2004 so the output looks like this 200401 how do i add the 01?
Cheers
Answer : using cast and case...
cast ( yourexpression as varchar(10)) + '01'
Random Solutions
Change table source for queries based on user or machine access
In Access 2007, need a VBA function to test external database table to see if it is empty
i'm getting a "RUNTIME ERROR 3167", plz help!
How Do I Create a “Totals by Department” Formula for a InfoPath Form Field?
DropDownList in DetailsView - ASP.NET C# codebehind
Concerns with translating Access 2003 application into Japanese?
NTBACKUP scheduled backup fails - VSS problem?
Shared Printer will not Print
Cannot sync outlook 2003 with exchange 2003
Adobe 7 Professional prints color reports in black and white