View Full Version : Date Difficulties!


dodie
12-14-2009, 11:18 PM
Hi Everyone,

Just a short one. I have Multiple Date Fields on a Report that I would like to be formatted as a long date but without the year. Can anyone help?

Therefore; Monday, 14th of December.

Not; Monday 14th of December 2009.

Thankyou in advance.

DCrake
12-15-2009, 12:40 AM
You can do it as such

Format([YourDate],"dddd, dd mmmm")

The only bit it does not provide is the nd,st,rd,th etc.

If you want this you would have to write a function to retreive this.

David

namliam
12-15-2009, 12:45 AM
Just take away the year...
Left ( format(Yourdate , "long date"), len(format(Yourdate , "long date")) -5 )

Rich
12-15-2009, 06:53 AM
Why not just set the Format display property of the textbox to
dddd mmmm d
no need for Format Functions?

dodie
12-15-2009, 04:08 PM
Thankyou all for taking the time to answer, I'm not sure if I'm doing something wrong but when I used your SQL Statements they came up with 'Error#' in the box I'm trying to format.

Let's say the field's name is [InstanceDate1].

I have used your suggestions in the Control Source property like so:

- Format([InstanceDate1],"dddd, dd mmmm")

- Left(Format([InstanceDate1], "Long date"), Len(Format([InstanceDate1], "Long date"))-5)

And for your suggestion Rich I was unsure where you put 'dddd mmmm d'?

Galaxiom
12-15-2009, 04:54 PM
And for your suggestion Rich I was unsure where you put 'dddd mmmm d'?

In the Format property of the textbox.

raskew
12-15-2009, 05:33 PM
Hi -

Try playing with this. Example from the debug (immediate) window:

? format(date(), "dddd") & ", " & day(date())& Nz(Choose(IIf(day(date()) < 21, day(date()), day(Date()) Mod 10), "st", "nd", "rd"), "th") & " of " & format(date(), "mmmm")
Tuesday, 15th of December

Realize it's a tad long, but it does return what you indicated.

HTH - Bob

namliam
12-15-2009, 10:43 PM
?Left(Format(Date(), "Long date"), Len(Format(Date(), "Long date"))-6)
Wednesday, December 16

works fine, though rich' answer is probably the best putting the format in the control box.
Only potential problem with that might be re-usability, how things "need" to look seems to change from time to time. I find it easier to have these formats stored in public places rather than specific controls of reports or forms.

Rich
12-15-2009, 10:59 PM
Won't the Left function etc create problems though with the dreaded Missing Reference problem?

namliam
12-15-2009, 11:26 PM
yes missing reference could be (one of) the reason(s) why it would fail