Concatenating

C

CK

I have a report and I want the Invoice Number to be of the format W0400001
where "W" is a fixed alphabet, 04 is the year 2004 and 00001 is auto-number
field. My questions:

1. How do I extract the last 2 digits of the year from any field of the
report that contains today's date?
2. How do I string all of these together so it will look right?

Thanks.
ck
 
M

Marshall Barton

CK said:
I have a report and I want the Invoice Number to be of the format W0400001
where "W" is a fixed alphabet, 04 is the year 2004 and 00001 is auto-number
field. My questions:

1. How do I extract the last 2 digits of the year from any field of the
report that contains today's date?
2. How do I string all of these together so it will look right?


A text box could use an expression like:

="W" & Format(datefield,"yy") & Format(numberfield,"000000")
 
C

CK

Thanks, Marshall. I tried with my fields but got an #Error instead. My actual
expression looks like this:

="W" & Format([dteInvoiceDate],"yy") &
Format([tblInvoice.lngInvoiceNo],"0000")

Is this right?
ck
 
D

Duane Hookom

PMFJI
One issue is the bracketing
="W" & Format([dteInvoiceDate],"yy") &
Format([tblInvoice].[lngInvoiceNo],"0000")
 
M

Marshall Barton

CK said:
Thanks, Marshall. I tried with my fields but got an #Error instead. My actual
expression looks like this:

="W" & Format([dteInvoiceDate],"yy") &
Format([tblInvoice.lngInvoiceNo],"0000")


Another possible problem is if the text box is named the
same as one of the fields it refers to. Make sure the text
box is named something other than lngInvoiceNo (and
dteInvoiceDate).
 
Top