Need your help

  • Thread starter mohsin via AccessMonster.com
  • Start date
M

mohsin via AccessMonster.com

Hi there

I need your help and expertise in this situation, please

FieldA Estimation Existing tblA
ResultA ResultA
21 021 021 021
36 024 24 024
18 012 12 012
775 307 307 307
A03 A03 A03 A03
6 006 006 006
0 000 000 000
2843 B1B B1B B1B


table A is list of Hex numbers, and field A is numbers which have a mix
format decimal and hex, then also mix length. What i'm trying to do is to
match Field A with tblA with condition:

IF fieldA = table A,add 0 or 00(with lentgh lest than 2),then if field A =
table A,choose fieldA, if false change field A to hex. as below queries. The
existing resultA as example above. And the estimatation result as above.

ResultA: IIf([FieldA]=[tblA],Right("00" & [FieldA],3),IIf([FieldA]=[tblA],
[FieldA],Hex([FieldA])))

Can you please advise me, what is the right queries, so as the i will get the
estimation result.

thank you
 
K

KARL DEWEY

Try this --
ResultA: IIf([tblA]= Right("00" & [FieldA],3),[FieldA], Hex([FieldA]))
 
J

John W. Vinson

Hi there

I need your help and expertise in this situation, please

FieldA Estimation Existing tblA
ResultA ResultA
21 021 021 021
36 024 24 024
18 012 12 012
775 307 307 307
A03 A03 A03 A03
6 006 006 006
0 000 000 000
2843 B1B B1B B1B


table A is list of Hex numbers, and field A is numbers which have a mix
format decimal and hex, then also mix length. What i'm trying to do is to
match Field A with tblA with condition:

IF fieldA = table A,add 0 or 00(with lentgh lest than 2),then if field A =
table A,choose fieldA, if false change field A to hex. as below queries. The
existing resultA as example above. And the estimatation result as above.

ResultA: IIf([FieldA]=[tblA],Right("00" & [FieldA],3),IIf([FieldA]=[tblA],
[FieldA],Hex([FieldA])))

Can you please advise me, what is the right queries, so as the i will get the
estimation result.

thank you

You've got a problem... a big one.

How on Earth can you tell whether 307 is x307 = 775, or decimal 307? Or vice
versa for that matter? Just by the existance of a match? What if there is a
307 AND a 775 in tblA - which one should match the value 775 in FieldA?

John W. Vinson [MVP]
 
M

mohsin via AccessMonster.com

Hi John

:) Actually the tblA is a custumize table, and all those information are in
Hex format.
and Field A is a input, which the format i got(due some mistake on database)
is in mix format-decimal and hex. So by by mapping with tblA, i know what is
right or not.
[quoted text clipped - 26 lines]
thank you

You've got a problem... a big one.

How on Earth can you tell whether 307 is x307 = 775, or decimal 307? Or vice
versa for that matter? Just by the existance of a match? What if there is a
307 AND a 775 in tblA - which one should match the value 775 in FieldA?

John W. Vinson [MVP]
 
J

John W. Vinson

Hi John

:) Actually the tblA is a custumize table, and all those information are in
Hex format.
and Field A is a input, which the format i got(due some mistake on database)
is in mix format-decimal and hex. So by by mapping with tblA, i know what is
right or not.

No, you don't.

Suppose there are two records in tblA, one for 307 and the other for 775.

You get a record in the input table with 775.

Which record is a match?

John W. Vinson [MVP]
 
M

mohsin via AccessMonster.com

hi john

:), as my checking so far, the result will take 307, if Field A = tblA, then
if not match, it will convert to hex format. so 775 is converted to HEX as a
307.
the tbl A only exist for 307 as HEX format, and 775 as Decimal format.
and basically, no two records in my list, to avoid such problem,
if exist, :) as you said, "big problem"

[quoted text clipped - 3 lines]
is in mix format-decimal and hex. So by by mapping with tblA, i know what is
right or not.

No, you don't.

Suppose there are two records in tblA, one for 307 and the other for 775.

You get a record in the input table with 775.

Which record is a match?

John W. Vinson [MVP]
 

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