Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine two fields as one for the ON statement

Status
Not open for further replies.

ceyhorn

Programmer
Nov 20, 2003
93
0
0
US
Code:
SELECT     dbo.AUDIT_LOG.AuditID, dbo.AUDIT_LOG.AuditType, dbo.AUDIT_LOG.TableName, dbo.AUDIT_LOG.UniqueFields, dbo.AUDIT_LOG.UniqueId, 
                      dbo.AUDIT_LOG.FieldName, dbo.AUDIT_LOG.OldValue, dbo.AUDIT_LOG.NewValue, dbo.AUDIT_LOG.AuditDate, dbo.AUDIT_LOG.AuditDate_NoTime, 
                      dbo.AUDIT_LOG.AuditUser
FROM         dbo.AUDIT_LOG INNER JOIN
                      dbo.tblGrant ON dbo.AUDIT_LOG.UniqueId = dbo.tblGrant.GrantID + GrantCountID
WHERE     (dbo.AUDIT_LOG.TableName = 'tblGrant') AND (dbo.AUDIT_LOG.NewValue LIKE 'GHLD')

I'm tring to combine two fields from one table as the relationship link in my inner join query. The ON section is where i'm having trouble, both fields come from the tblGrant, any ideas on how i can concentrate these fields?

Thanks in advance for any suggestions,

Chris
 
Try
Code:
FROM         dbo.AUDIT_LOG INNER JOIN
                      dbo.tblGrant ON dbo.AUDIT_LOG.UniqueId = dbo.tblGrant.GrantID + dbo.tablGrant.GrantCountID{/code]

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top