473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with Function to redisplay a cost price...

I'm trying to write a function to achieve the following;

Some bright spark thought it would be a good idea to have a report
that has the cost price masked with the first 10 letters of the
alphabet - sometimes these reports are used in front of our customers
and our guy needs to know the cost-price without the customer being
aware of it.

So 200 would read AJJ, 350 would read CEJ etc

I'm trying to put together a function to convert the numerical
characters into component parts, but I am stuck at how to start.

I'm thinking I'd need a SELECT Case statement to determine the letters
of the alphabet that will substitute the numerical characters, but how
to go through the numerical character is a bit of an obstacle! I've
sat with a blank screen for a good half hour now :-(

If anyone has any pointers, I'd be grateful

Many thanks to anyone who can assist,

Cheers,

Phil
Nov 12 '05 #1
2 1280
Just off the top of my head, I would convert your cost price to a string
using CSTR(350), get length with LEN, then cycle thru the string LEN times
adding 65 to each and concatenating CHR(x) as the resulting letter.
In the immediate window, I can ?LEFT(CSTR(523),1)+65 which gives me 70 (for
the 5) and ?chr(70) gives me an F.
so, try a for next loop... We are assuming this is all whole numbers,
right? No $123.45.. cause then we would have to attack the decimal or
convert to integer.

This should get you started....
Damon

"Phil.Latio" <ph********@lycos.co.uk> wrote in message
news:28*************************@posting.google.co m...
I'm trying to write a function to achieve the following;

Some bright spark thought it would be a good idea to have a report
that has the cost price masked with the first 10 letters of the
alphabet - sometimes these reports are used in front of our customers
and our guy needs to know the cost-price without the customer being
aware of it.

So 200 would read AJJ, 350 would read CEJ etc

I'm trying to put together a function to convert the numerical
characters into component parts, but I am stuck at how to start.

I'm thinking I'd need a SELECT Case statement to determine the letters
of the alphabet that will substitute the numerical characters, but how
to go through the numerical character is a bit of an obstacle! I've
sat with a blank screen for a good half hour now :-(

If anyone has any pointers, I'd be grateful

Many thanks to anyone who can assist,

Cheers,

Phil

Nov 12 '05 #2
Hi Damon,

Sorry for the delay in responding to your helpful suggestion!
I got it to work a treat - even though they wanted to alias the
numerical characters with those from a meaningful phrase as opposed
straight abc... etc!

Many thanks, for the pointers and not giving a single bit of code,
just the thought process - thanks again.

Cheers,

Phil
"Damon Heron" <da******@hotmail.com> wrote in message news:<D6********************@comcast.com>...
Just off the top of my head, I would convert your cost price to a string
using CSTR(350), get length with LEN, then cycle thru the string LEN times
adding 65 to each and concatenating CHR(x) as the resulting letter.
In the immediate window, I can ?LEFT(CSTR(523),1)+65 which gives me 70 (for
the 5) and ?chr(70) gives me an F.
so, try a for next loop... We are assuming this is all whole numbers,
right? No $123.45.. cause then we would have to attack the decimal or
convert to integer.

This should get you started....
Damon

"Phil.Latio" <ph********@lycos.co.uk> wrote in message
news:28*************************@posting.google.co m...
I'm trying to write a function to achieve the following;

Some bright spark thought it would be a good idea to have a report
that has the cost price masked with the first 10 letters of the
alphabet - sometimes these reports are used in front of our customers
and our guy needs to know the cost-price without the customer being
aware of it.

So 200 would read AJJ, 350 would read CEJ etc

I'm trying to put together a function to convert the numerical
characters into component parts, but I am stuck at how to start.

I'm thinking I'd need a SELECT Case statement to determine the letters
of the alphabet that will substitute the numerical characters, but how
to go through the numerical character is a bit of an obstacle! I've
sat with a blank screen for a good half hour now :-(

If anyone has any pointers, I'd be grateful

Many thanks to anyone who can assist,

Cheers,

Phil

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Paul Taylor | last post by:
I want to show a figure based on an numeric entry that more than 20 (or 21and higher). If Number value is 21 or higher then the amount returned is Number value * 120 (£) * 10 (%) to give a...
1
by: AKF | last post by:
I am trying to use data structures to open a file (void display_Stock_Item(Stock_Item si);) from a text file. I also need to be able to write to the file and also to delete from the file using...
29
by: shadachi | last post by:
This is the question?.. can anyone help me?? kinda confused..using JcreatorLe SAmple Output :
1
by: aprillynn82 | last post by:
I am making a retail price calculator for a school project. We are to write an application that accepts the wholesale cost and its markup percentage. We have to verify the values entered for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.