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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to extract specific data from FUYNCTION

Status
Not open for further replies.

specialist

Programmer
Sep 7, 2001
50
US
greetings-

is there a way to extract specific information from a function? For example:

Code:
Function FindTOTAL_OPEN_123
   FindTOTAL_OPEN_123 = FindOPEN_ALA + FindOPEN_ALA_CAT2
End Function

Say I wanted to count the number of records in this function which had a value of:
store_id = 123

Ultimately, I would like to count the number of records with store_id = 123 from the total records displayed in the function FindTOTAL_OPEN_123.

Any guidance would be warmly welcome.
Thank you kindly,

Mike

P.S. Have a nice day :)
 
pretty difficult to work out from your function as we don't what FindOPEN_ALA and FindOPEN_ALA_CAT2 are.


but

Code:
function CountRecords(intStoreID)
dim objConn
dim objRS
dim strSQL

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strSQLConnString 
Set objRS = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT COUNT(*) as RecCount FROM table WHERE storeidfield = " & intStoreID & ";"
objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
CountRecords = objRS.RecCount

objRS.close
set objRS = Nothing
objConn.close
set objConn = Nothing
end function
should work (not tested btw)

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
Chris-

Just uploded and it worked like a charm!! Thank you very much!

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top