Hi.
I am pulling dates from an AS400 where the date is formatted as 1050701 for
todays date. CYYMMDD.
I have tried to use the date format for the field (d), but the date does not
change.
Any ideas how I can format this type of date to display as MM/DD/YY.
Thanksi think you'll have to write some custom code to handle the AS400 date format
you're getting. in the cell that is displaying the date you just need
something like this: =code.FormatAsMMDDYY(AS400date)
read about writing custom code in BOL.
"Susan" wrote:
> Hi.
> I am pulling dates from an AS400 where the date is formatted as 1050701 for
> todays date. CYYMMDD.
> I have tried to use the date format for the field (d), but the date does not
> change.
> Any ideas how I can format this type of date to display as MM/DD/YY.
> Thanks
Showing posts with label todays. Show all posts
Showing posts with label todays. Show all posts
Saturday, February 25, 2012
Dates Result Set
Hi, All,
I need a single result set that just returns today's date
plus 6 more days. I want to do this without a cursor.
Any ideas?
Thanks!
T
Here is one solution:
select cast(convert(char(8),getdate(),112) as datetime) + i as d
from (
select 0 as i union all select 1 union all select 2 union all select 3
union all select 4 union all select 5 union all select 6
) T
Steve Kass
Drew University
tom sawyer wrote:
>Hi, All,
>I need a single result set that just returns today's date
>plus 6 more days. I want to do this without a cursor.
>Any ideas?
>Thanks!
>T
>
I need a single result set that just returns today's date
plus 6 more days. I want to do this without a cursor.
Any ideas?
Thanks!
T
Here is one solution:
select cast(convert(char(8),getdate(),112) as datetime) + i as d
from (
select 0 as i union all select 1 union all select 2 union all select 3
union all select 4 union all select 5 union all select 6
) T
Steve Kass
Drew University
tom sawyer wrote:
>Hi, All,
>I need a single result set that just returns today's date
>plus 6 more days. I want to do this without a cursor.
>Any ideas?
>Thanks!
>T
>
Subscribe to:
Posts (Atom)