Hi there,
I am haveing some problems using the Count function. What I am attempting to do is output a list of recorded equipment with the total beside each piece e.g. Equip1 = 3, Equip2 = 5 etc.
This is what I have so far:-
Set objconn = Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strconn = "DSN=Worry-not; Database=tdotcom Database;"
strconn = strconn & "UID=;PWD=;"
objconn.Open strconn
Set objRS = Server.CreateObject("ADODB.Recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strQ = "SELECT Location, Count(tbl_Parts.PartDescript) AS Records "
strQ = strQ & "FROM tbl_CustomerLocations, tbl_Parts, tble_Customers, tbl_EquipCfg, EquipCfgParts "
strQ = strQ & "WHERE tble_Customers.recid = '" & request.cookies("passes2"
& "' "
strQ = strQ & "AND tbl_CustomerLocations.CustomerId = tble_Customers.recid "
strQ = strQ & "AND tbl_EquipCfg.LocationId = tbl_CustomerLocations.recId "
strQ = strQ & "AND tbl_EquipCfg.recid = tbl_EquipCfgParts.EquipCfgId "
strQ = strQ & "AND tbl_EquipCfgParts.PartId = tbl_Parts.recid "
strQ = strQ & "GROUP BY tbl_Parts.PartDescript "
strQ = strQ & "ORDER BY tbl_Parts.PartDescript DESC "
objRS.Open strQ
Please can you shed some light on where my problem lies. Thank you.
I am haveing some problems using the Count function. What I am attempting to do is output a list of recorded equipment with the total beside each piece e.g. Equip1 = 3, Equip2 = 5 etc.
This is what I have so far:-
Set objconn = Server.CreateObject("ADODB.Connection"
strconn = "DSN=Worry-not; Database=tdotcom Database;"
strconn = strconn & "UID=;PWD=;"
objconn.Open strconn
Set objRS = Server.CreateObject("ADODB.Recordset"
strQ = "SELECT Location, Count(tbl_Parts.PartDescript) AS Records "
strQ = strQ & "FROM tbl_CustomerLocations, tbl_Parts, tble_Customers, tbl_EquipCfg, EquipCfgParts "
strQ = strQ & "WHERE tble_Customers.recid = '" & request.cookies("passes2"
strQ = strQ & "AND tbl_CustomerLocations.CustomerId = tble_Customers.recid "
strQ = strQ & "AND tbl_EquipCfg.LocationId = tbl_CustomerLocations.recId "
strQ = strQ & "AND tbl_EquipCfg.recid = tbl_EquipCfgParts.EquipCfgId "
strQ = strQ & "AND tbl_EquipCfgParts.PartId = tbl_Parts.recid "
strQ = strQ & "GROUP BY tbl_Parts.PartDescript "
strQ = strQ & "ORDER BY tbl_Parts.PartDescript DESC "
objRS.Open strQ
Please can you shed some light on where my problem lies. Thank you.