Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / June 2007

Tip: Looking for answers? Try searching our database.

Need to display leading zeros in concatenation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marty - 24 Jun 2007 21:08 GMT
In my table I have a job code field that is formated 0000. I need to
concatenate that filed with the job title field in a query with a dash
between. Example:
Job Code: 0006
Job Title: Slave
Result: 0006-Slave

I've done the concatenation in an expression field in my query but it drops
the leading zeros. Here's what I've used:

Expr2: [Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Code] & "-" &
[Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Title]

I don't have the option of changing the job code field to text because the
data comes from a query run to Excel from in another program and when I
change the format of the column to text I lose the zeros.

Thanks for your help.
Wayne-I-M - 24 Jun 2007 21:34 GMT
Format([Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Code], "0000") & "-" &
[Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Title]

Signature

Wayne
Manchester, England.

> In my table I have a job code field that is formated 0000. I need to
> concatenate that filed with the job title field in a query with a dash
[quoted text clipped - 14 lines]
>
> Thanks for your help.
Marty - 24 Jun 2007 21:42 GMT
Thanks so much! Works like a charm!

> Format([Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Code], "0000") & "-" &
> [Tbl_NCBHNewHire60-DayTBComplianceStatus]![Job Title]
[quoted text clipped - 17 lines]
> >
> > Thanks for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.