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 / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Need your help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mohsin - 09 Nov 2007 16:10 GMT
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

Signature

Cheers
Mohsin

KARL DEWEY - 09 Nov 2007 16:47 GMT
Try this --
ResultA: IIf([tblA]= Right("00" & [FieldA],3),[FieldA], Hex([FieldA]))

Signature

KARL DEWEY
Build a little - Test a little

> Hi there
>
[quoted text clipped - 26 lines]
>
> thank you
John W. Vinson - 09 Nov 2007 22:25 GMT
>Hi there
>
[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]
mohsin - 10 Nov 2007 11:07 GMT
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.

>>Hi there
>>
[quoted text clipped - 9 lines]
>
>             John W. Vinson [MVP]

Signature

Cheers
Mohsin

John W. Vinson - 11 Nov 2007 07:10 GMT
>Hi John
>
[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]
mohsin - 12 Nov 2007 11:07 GMT
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"

>>Hi John
>>
[quoted text clipped - 11 lines]
>
>             John W. Vinson [MVP]

Signature

Cheers
Mohsin

 
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.