Format Dates: Sunday, Feb 1, 2009 to Saturday, Feb 7, 2009

R

ryguy7272

I am trying to get my dates in this format:
Sunday, Feb 1, 2009 to Saturday, Feb 7, 2009

This is in a TextBox on a Form. Basically, I’d like to see the current week
when I open the From. So, for today, which is Saturday, Feb 7, 2009, I’d
like to see the format above. When I open my Form tomorrow, which is Sunday,
Feb 8, 2009, I’d like to see the current week, like this:
Sunday, Feb 8, 2009 to Saturday, Feb 14, 2009

I’m trying the function below, but not getting the results I am after:
=Format(DateAdd("d",1-Weekday(Date()),Date()),"dddd") & " to " &
Format(DateAdd("d",7-Weekday(Date()),Date()),"dddd")

This shows Sunday to Saturday, with no dates.

There is probably an easier way of doing this. What am I doing wrong.


Thanks,
Ryan---
 
R

Rick Brandt

I am trying to get my dates in this format: Sunday, Feb 1, 2009 to
Saturday, Feb 7, 2009

This is in a TextBox on a Form. Basically, I’d like to see the current
week when I open the From. So, for today, which is Saturday, Feb 7,
2009, I’d like to see the format above. When I open my Form tomorrow,
which is Sunday, Feb 8, 2009, I’d like to see the current week, like
this: Sunday, Feb 8, 2009 to Saturday, Feb 14, 2009

I’m trying the function below, but not getting the results I am after:
=Format(DateAdd("d",1-Weekday(Date()),Date()),"dddd") & " to " &
Format(DateAdd("d",7-Weekday(Date()),Date()),"dddd")

This shows Sunday to Saturday, with no dates.

There is probably an easier way of doing this. What am I doing wrong.

Your format expression is not set up to show dates, only days.

Format(SomeDate, "dddd")

....will only give the day of the week. You need...

Format(SomeDate, "dddd, mmmm yyyy")
 
J

John W. Vinson

I’m trying the function below, but not getting the results I am after:
=Format(DateAdd("d",1-Weekday(Date()),Date()),"dddd") & " to " &
Format(DateAdd("d",7-Weekday(Date()),Date()),"dddd")

This shows Sunday to Saturday, with no dates.

There is probably an easier way of doing this. What am I doing wrong.

It's giving you precisely what you asked for: dddd is the format expression
for the written-out day of the week.

Try using a format of

"dddd, mmm dd, yyyy"

to get the day name, abbreviated month name (mmm), day number (dd) and year.
 
R

ryguy7272

Wow; pretty slick!! I went with this:
=Format(DateAdd("d",1-Weekday(Date()),Date()),"dddd, mmmm dd, yyyy") & " to
" & Format(DateAdd("d",7-Weekday(Date()),Date()),"dddd, mmmm dd, yyyy")

Thanks Rick and John!!


Regards,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top