Formating date in a merge field (1 Viewer)

Ants

Registered User.
Local time
Today, 23:39
Joined
Aug 2, 2000
Messages
11
I have used the following code in the control source of a field to merge two fields:

=[Account Ref] & "" & [Year]

When I go to preview the report, I notice that the field is fine with the account ref part, however the year section is returned with the time and today's date.

The field [Year] has its control source set at Now() with format as yy (This appears fine in the report preveiw).

I hav tried using Date()in this field, but whenever I go to report preveiw it asks me for the parameter value.

I look forward to anybody's help
 

Fornatian

Dim Person
Local time
Today, 23:39
Joined
Sep 1, 2000
Messages
1,396
Try:

=[Account Ref] & "" & Format([Year],"yyyy")
for "AcRef2000"
or
=[Account Ref] & "" & Format([Year],"yy")
for AcRef00

HTH

Ian
 

Ants

Registered User.
Local time
Today, 23:39
Joined
Aug 2, 2000
Messages
11
Many thanks for the reply.

However after entering in your new expression I get the message about the expression containing invalid syntax. I copied the expression as it appears on this site.

=[Account Ref] & "" & Format([Year],"yy")

Any suggestions!
 

Fornatian

Dim Person
Local time
Today, 23:39
Joined
Sep 1, 2000
Messages
1,396
=[Account Ref] & "" & Format([Year],"yy")

If you want the items concantenated then take out the "". If you want a space add " " instead of "".

Make sure the field names I've used are exactly the same as the ones you have.

Should sort it.
Else reply
 

Users who are viewing this thread

Top Bottom