LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Padding out reference numbers

Hi,
I think this is an Excel query, although I'll be linking
the table to an Access database. I've encountered a
problem regarding reference numbers (which is the primary
key in the Access database) not being in the same format.

My objective is to be able to consolidate a number of
records where the primary keys are not equal. For
example, data in the format:

Ref Company Date Amount
456/100/001C Bloggs & Co 12/12/03 £2000
456/100/001LC Bloggs & Co 12/12/03 £4000
456/100/001LT Bloggs & Co 12/12/03 £1500
12/101/002LT Smith & Co 15/11/03 £1000
12/101/002LC Smith & Co 15/11/03 £3000

to become:
Ref Company Date Amount
456/100/001 Bloggs & Co 12/12/03 £7500
12/101/002 Smith & Co 15/11/03 £4000

My problem is that I can't use the Left() function in
Access because of the inequalities. So I was wondering if
there's a way of identifying the length of the ref number
within Excel and then padding with zeros at the beginning
in order to use the Left() function?

BUT, there is also the issue that a reference can vary in
length from:
####/###/###??? to #######??# or ##/###/###?
where '#' indicates a number and '?' indicates a character.

Has anyone got any ideas on how this can be achieved (if
it is possible)? I hope so!

Amanda
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell padding Jennifer Excel Discussion (Misc queries) 1 December 3rd 09 10:37 PM
Padding and Concatenate Static Excel Discussion (Misc queries) 2 November 2nd 07 07:40 PM
Cell margins/padding ll17 Excel Discussion (Misc queries) 1 May 7th 07 11:10 PM
padding ? vbastarter Excel Discussion (Misc queries) 2 March 7th 06 12:11 PM
Value padding in VBA raj Excel Programming 2 December 14th 03 09:51 PM


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"