I am having issues with joining two tables in a query and then sorting the
results based on the second table. I want to query both the
[SubCatergory2Products] and [Sub Categories] tables, joined by the
SubCategory ID and ID fields respectively.  The only info provided is the
CategoryID number (as seen below). 

 

 

Here is the code:

 

query([SubCategory2Products];[SubCategory2Products]CategoryID = $addCatID;*)

query([Sub Categories];&;[Sub Categories]ID =
[SubCategory2Products]SubCategoryID)

order by([Sub Categories];[Sub Categories]Code;>)

 

distinct values([SubCategory2Products]SubCategoryID;$arrSubCatID)

 

for ($i;1;size of array ($arrSubCatID))      

                query([Sub Categories];[Sub Categories]ID =
$arrSubCatID{$i};*)

                query([Sub Categories];&;[Sub Categories]Inactive # True)

                                $old_char := char(39)

                                $addSubCatCode := replace string([Sub
Categories]Code;$old_char;"")

                                $addSubCatName := replace string([Sub
Categories]Name;$old_char;"")

                                write("obj.options[obj.options.length] = new
Option('"+$addSubCatCode + " - " +
$addSubCatName+"','"+$arrSubCatID{$i}+"');")

end for

 

 

 

It would seem that the problem is with the ORDER BY line...no matter what I
do there, it changes nothing.  I am confused as to how to get this to work
and know I must be doing something wrong in here somewhere, but there are no
errors given when the code runs, it just doesn't sort as I expect it to.  Am
I going about this the wrong way?  Any help would be much appreciated.

 

 

 

Sincerely, 

 

 

Jason Tupeck

InterTech USA, Inc.

6070 Industrial Road

Missoula, MT 59808-8412

Phone: 406.549.8998 x231

Toll-Free: 800.291.6517 x231

Fax: 406.721.7991

Web: http://www.intertech-usa.com 

 


Confidentiality Note: The information contained in this email and document(s) 
attached are for the exclusive use of the addressee and may contain 
confidential, privileged and non-disclosable information and is covered by the 
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521. If the recipient of 
this email is not the addressee, such recipient is strictly prohibited from 
reading, photocopying, distributing or otherwise using this email or its 
contents in any way.


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to