Leading 0 - Sql Query

K

Karin

I'm having trouble posting this, so I'm going to try to do it in 2 posts.
Hi, I have a an Excel file with a parameters sheet and SQL query behind it.
One Client (ClientNum) can have multiple Projects (CltProj). You can enter
a range of projects on the parameter sheet. It used to be straight forward
0, 1, 2. They have changed ID system to be any of the following (I can't do
anything about this part): 0 01 2 21 30
or any combination. It's the 0, 01 part that I think has me lost.
Next post to contain current query
 
K

Karin

I can't seem to post anything with any type of coding in it to give an example

I'm really lost. Maybe I need to convert to string? Any help would be
HUGELY appreciated.
TIA - Karin
 
S

Shane Devenshire

Hi,

Yes, you probably need to convert to a string since I'm assuming the 01 is
not a cell with 1 formatted to show leading zeros. But I need to see you
code to make a constructive suggestion.

I don't see why you can't post your code - is this another problem with this
web site? We seem to be having so many problems these days - repetative
post, error messages saying the post didn't work, ....
 
K

Karin

Thank you for responding. The field I'm pulling data from is a varchar,
length 5.
Because the company is in the process of converting all of the clients to a
new numbering system, it's not consistent in the field. Also, it could be a
0 or a 01 (out to 5 total digits). I'm lost at getting only a 0 or a 01
(same for 1-9 could be 8 or 81). Modified code is
get client name from the table where the client id matches the input
then I'm trying to convert the field name is cltproj which I have named as
BegProj
and convert int cltproj equal begproj and isnumeric cltproj = 1
So I'm converting to an integer but this is clearly not the right thing to
do. I fully admit I'm not that good at this stuff -- yet :)

I can't get the code through any other way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top