8/23/2025 3:27:45 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
SQL join issue in a datagrid
Posted: 28 Feb 08 8:07 PM
|
I'm trying to load a datagrid with the following sql. Teh problem is that the first field, the one field from a joined table, will not show up.
select Name , saved, DEVICE_ID, ported from ce_quote_wireless cqw left Join product p On (p.PRODUCTID = cqw.PRODUCTID)
This works fine in Toad, but the first column is blank in the datagrid.
With dgWireless .SQL.Text = "select Name , saved, DEVICE_ID, ported from ce_quote_wireless cqw left Join product p On (p.PRODUCTID = cqw.PRODUCTID)"
With .Columns 'remove any existing columns If (.Count > 0) Then For i = 0 To .Count - 1 .Item(0).Delete Next End If
'add column for ACCOUNT field
Set col = .add(0) col.FieldName ="Name" col.Caption = "Device" col.ReadOnly = True
Set col = .Add(0) col.FieldName ="device_id" col.Caption = "Device ID" col.ReadOnly = True .....
Thanks very much |
|
|
|
Re: SQL join issue in a datagrid
Posted: 29 Feb 08 12:08 AM
|
Name is probably a reserved word try changing the query as follows (the brackets allow you to use reserved words as field names)
"select [Name] , saved, DEVICE_ID, ported from ce_quote_wireless cqw left Join product p On (p.PRODUCTID = cqw.PRODUCTID)"
if that doesn't work try this:
"select Name as myName , saved, DEVICE_ID, ported from ce_quote_wireless cqw left Join product p On (p.PRODUCTID = cqw.PRODUCTID)" which will make your first column name "myName"
finally, you may want to prefix your field like so: "select p.Name as [Name], saved, DEVICE_ID, ported from ce_quote_wireless cqw left Join product p On (p.PRODUCTID = cqw.PRODUCTID)"
ONE of these will work 
|
|
|
|
Re: SQL join issue in a datagrid
Posted: 29 Feb 08 11:43 AM
|
Thanks, but I found my stupid mistake. I did not have one of the tables filled properly. I do not understand why it worked in TOAD, but it did.
Again, Thanks very much. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|