Solved

Format text box, mmm ddd yyyy

Posted on 2011-03-12
13
494 Views
Last Modified: 2012-05-11
Experts,

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

as mmm dd yyyy

thanks
0
Comment
Question by:pdvsa
  • 6
  • 4
  • 3
13 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
How about ...

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

mx
0
 

Author Comment

by:pdvsa
Comment Utility
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
 

Author Comment

by:pdvsa
Comment Utility
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
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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
 

Author Comment

by:pdvsa
Comment Utility
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
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Looks to me they are exactly the same (other than Format) ... beyond weird.


Capture1.gif
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:pdvsa
Comment Utility
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
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
Comment Utility
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
 

Author Comment

by:pdvsa
Comment Utility
Ok.   Will test this when @ cmptr.  Thx
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
But how does that explain that the date is the same for the example that is Formatted ?

mx
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
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
 

Author Closing Comment

by:pdvsa
Comment Utility
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
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
Well, the idea is that you can format a date to nearly whatever string expression you may wish.

/gustav
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now