Unable to format Date field in a query

G

Guest

MS Access 2000, Windows XP
=======================
Hi,

I have a query based on a table that has the following two fields:
1. ContactTitle
2. ContactDate [formatted as Short Date in the table, and as
{mm"/"dd"/"yyyy} in the Query->Field Properties->Format]

I want to use an expression that combines these two fields, and I want the
date to display in the format "mm/dd/yyyy", that is, show the leading zero
for month and date. But, this is not happening.

When I run the query, the ContactDate is displayed correctly in the format
mm/dd/yyyy, but if I use the following expression--
[ContactTitle] & " - " & [ContactDate]
either in the query, or as control source for a combo-box in a form, the
date is not displayed as mm/dd/yyyy, and the leading zeroes are not displayed.

Will appreciate any help on how to format the date in the query to display
correctly when part of an expression.

Thanks!

-Amit
 
R

Rick Brandt

Amit said:
MS Access 2000, Windows XP
=======================
Hi,

I have a query based on a table that has the following two fields:
1. ContactTitle
2. ContactDate [formatted as Short Date in the table, and as
{mm"/"dd"/"yyyy} in the Query->Field Properties->Format]

I want to use an expression that combines these two fields, and I
want the date to display in the format "mm/dd/yyyy", that is, show
the leading zero for month and date. But, this is not happening.

When I run the query, the ContactDate is displayed correctly in the
format mm/dd/yyyy, but if I use the following expression--
[ContactTitle] & " - " & [ContactDate]
either in the query, or as control source for a combo-box in a form,
the
date is not displayed as mm/dd/yyyy, and the leading zeroes are not
displayed.

Will appreciate any help on how to format the date in the query to
display correctly when part of an expression.

[ContactTitle] & " - " & Format([ContactDate],"mm/dd/yyyy")
 

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