Formatting Time

G

GregInOz

Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In]," dd/mmm/yyyy" &
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
A

Allen Browne

Try setting the properties of your text box like this:
Control Source Date Due In
Format dddd dd/mmm/yyyy \~ h:nn ampm
 
G

GregInOz

bcap,

I had already tried am/pm, however I get....... p12

I think it's reading the m as months....who knows?

bcap said:
Er, maybe use am/pm instead of a/p?


GregInOz said:
Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In]," dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
G

GregInOz

Hi Allen,

Your suggestion definately works in so much as i now get the am or pm,
however it was the incorrect time as i'm bringing the date from a field
called [Date Due In] and the time from another field called [Time Due In].

The field i'm trying to populate is unbound field called [DateTimeDueIn]

Greg


Allen Browne said:
Try setting the properties of your text box like this:
Control Source Date Due In
Format dddd dd/mmm/yyyy \~ h:nn ampm

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

GregInOz said:
Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In]," dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
B

bcap

I don't understand why you've nested the Format functions. It works if you
simply concatenate them like this:

Format([Date Due In],"dddd") & ", " & Format([Date Due In]," dd/mmm/yyyy") &
" ~ " & Format([Time Due In],"h:nn am/pm")

Or, more simply:

Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due In],"h:nn
am/pm")

GregInOz said:
bcap,

I had already tried am/pm, however I get....... p12

I think it's reading the m as months....who knows?

bcap said:
Er, maybe use am/pm instead of a/p?


GregInOz said:
Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but
there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In],"
dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or
pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
G

GregInOz

bcap,

Nested? Inexperience would be the answer to that one lol.

It's almost perfect, the AM/PM is now showing, but i've got 24hr time.

e.g 13.00 PM

Greg

bcap said:
I don't understand why you've nested the Format functions. It works if you
simply concatenate them like this:

Format([Date Due In],"dddd") & ", " & Format([Date Due In]," dd/mmm/yyyy") &
" ~ " & Format([Time Due In],"h:nn am/pm")

Or, more simply:

Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due In],"h:nn
am/pm")

GregInOz said:
bcap,

I had already tried am/pm, however I get....... p12

I think it's reading the m as months....who knows?

bcap said:
Er, maybe use am/pm instead of a/p?


Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but
there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In],"
dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or
pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
G

GregInOz

bcap,

Hmmmmm, now it's working with this.....

=Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due
In],"h:nn AM/PM" & "")

Must have been something silly i typed in there???

Anyway, big thanks for your help !!!

Greg

bcap said:
I don't understand why you've nested the Format functions. It works if you
simply concatenate them like this:

Format([Date Due In],"dddd") & ", " & Format([Date Due In]," dd/mmm/yyyy") &
" ~ " & Format([Time Due In],"h:nn am/pm")

Or, more simply:

Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due In],"h:nn
am/pm")

GregInOz said:
bcap,

I had already tried am/pm, however I get....... p12

I think it's reading the m as months....who knows?

bcap said:
Er, maybe use am/pm instead of a/p?


Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but
there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In],"
dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or
pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
B

bcap

Great, glad you've got it sorted! :)

GregInOz said:
bcap,

Hmmmmm, now it's working with this.....

=Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due
In],"h:nn AM/PM" & "")

Must have been something silly i typed in there???

Anyway, big thanks for your help !!!

Greg

bcap said:
I don't understand why you've nested the Format functions. It works if
you
simply concatenate them like this:

Format([Date Due In],"dddd") & ", " & Format([Date Due In],"
dd/mmm/yyyy") &
" ~ " & Format([Time Due In],"h:nn am/pm")

Or, more simply:

Format([Date Due In],"dddd, dd/mmm/yyyy ~ ") & Format([Time Due
In],"h:nn
am/pm")

GregInOz said:
bcap,

I had already tried am/pm, however I get....... p12

I think it's reading the m as months....who knows?

:

Er, maybe use am/pm instead of a/p?


Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but
there
must be something i'm doing wrong......Need Help before I go nuts
!!!

I have this in the Control Source of a field called DateTimeIn
within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In],"
dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or
pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 
A

Allen Browne

Set the Control Source to:
=[Date Due In] + [Due Time In]

Make sure the Name property is not the same as any field name, e.g. you
could change it to (say) Text234

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

GregInOz said:
Hi Allen,

Your suggestion definately works in so much as i now get the am or pm,
however it was the incorrect time as i'm bringing the date from a field
called [Date Due In] and the time from another field called [Time Due In].

The field i'm trying to populate is unbound field called [DateTimeDueIn]

Greg


Allen Browne said:
Try setting the properties of your text box like this:
Control Source Date Due In
Format dddd dd/mmm/yyyy \~ h:nn ampm

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

GregInOz said:
Hi Guys,

I've read numerous posts and found exactly what i'm looking for, but
there
must be something i'm doing wrong......Need Help before I go nuts !!!

I have this in the Control Source of a field called DateTimeIn within a
report.

=Format([Date Due In],"dddd" & ", " & Format([Date Due In],"
dd/mmm/yyyy"
&
" ~ " & Format([Time Due In],"h:nn a/p" & "")))

I get 99% of what i'm looking for, but it won't put the "m" on am or
pm???

For example: Friday, 8/Aug/2008 ~ 1.00 p

Of course i'm looking for: Friday, 8/Aug/2008 ~ 1.00 pm

Greg
 

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