Concatenating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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")
 
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
 
PMFJI
One issue is the bracketing
="W" & Format([dteInvoiceDate],"yy") &
Format([tblInvoice].[lngInvoiceNo],"0000")
 
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).
 
Back
Top