Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 530
  • Last Modified:

Format text box, mmm ddd yyyy

Experts,

How do I format this:
=[Forms]![frmDateRange_Weekly].[txtdatefrom] & " - " & [Forms]![frmDateRange_Weekly].[txtDateTo]

as mmm dd yyyy

thanks
0
pdvsa
Asked:
pdvsa
  • 6
  • 4
  • 3
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
How about ...

=Format([Forms]![frmDateRange_Weekly].[txtdatefrom],"mmm dd yyyy") & " - " & Format([Forms]![frmDateRange_Weekly].[txtDateTo],"mmm dd yyyy")

mx
0
 
pdvsaProject financeAuthor Commented:
Mx:  I had to change the order of the ddd mmm but I dont seem to get the dates from the frmDateRange.  There are no mispellings.  

=Format([Forms]![frmDateRange].[txtdatefrom],"ddd mm yyyy") & " - " & Format([Forms]![frmDateRange].[txtDateTo],"ddd mm yyyy")

IN the attached screen print.   The one on the right is without any formatting.  The one on the left is with the formatting.  But you can see the dates are not correct between the two.  The one on the right is referencing the correct dates.  
untitled.JPG
0
 
pdvsaProject financeAuthor Commented:
Do you see anything wrong with the formatting of the above?  The only reason why the dates are different is because of the formatting on the left one.  
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I see nothing wrong.  It simply looks as if the same date was put into txtDateFrom and txtDateTo ... ?
It is certainly working correctly in the Formatting sense.

mx
0
 
pdvsaProject financeAuthor Commented:
but this is not the case.  I copied and pasted that textbox.  The ONLY difference is the formatting.  

left one:
=Format([Forms]![frmDateRange].[txtdatefrom],"ddd mm yyyy") & " - " & Format([Forms]![frmDateRange].[txtDateTo],"ddd mm yyyy")

right one:
=[Forms]![frmDateRange].[txtdatefrom] & " - " & [Forms]![frmDateRange].[txtDateTo]


Do you see any issue here?  Maybe I am missing something.  I also tried single and double quotes.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Looks to me they are exactly the same (other than Format) ... beyond weird.


Capture1.gif
0
 
pdvsaProject financeAuthor Commented:
well fiddle sticks.  that is weird.  At least I am not crazy because I did the same thing you did to format it before I posted the question and did not work right.  Must be an answer to this.  Maybe corruption or something but I have compacted repaired and  compiled.  Oh well it will sort itself out.  Maybe I did something screwy somewhere.  
0
 
Gustav BrockCIOCommented:
Nothing wrong with the formats, but you have to make up your mind.
If you wish the day and not the month use this format:

"dddd dd yyyy"

/gustav
0
 
pdvsaProject financeAuthor Commented:
Ok.   Will test this when @ cmptr.  Thx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
But how does that explain that the date is the same for the example that is Formatted ?

mx
0
 
Gustav BrockCIOCommented:
You omit the day, only displaying the weekday and month and year.
As the example dates are one week apart, they then look the same.

/gustav
0
 
pdvsaProject financeAuthor Commented:
Gustav, it worked.  

the following did not even work for dates that were far apart and I dont completely understand why:
=Format([Forms]![frmDateRange].[txtdatefrom],"ddd mm yyyy") & " - " & Format([Forms]![frmDateRange].[txtDateTo],"ddd mm yyyy")

I believe you mentioned to use "dddd dd yyyy" for when dates are close together.  I have never heard of using that format order.  It is not logical.  Oh well at least I have what works.  Thank you.
0
 
Gustav BrockCIOCommented:
Well, the idea is that you can format a date to nearly whatever string expression you may wish.

/gustav
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now