Joined: July/04/2005 Location: United Kingdom
Online Status: Offline Info: 1
Added: July/04/2005 at 12:47pm | IP Logged
Hi some one out there must do how to do this,
I have been able to return results from the database when a client id is selected but i need it to do this,
for sa users, instead of having to choose a client, if they haven't
chosen one display all records received today from every received table
( received_0 , recived_1 etc etc)
heres some of the code:
' Get the received messages from the received table(s)
if session("sa") = "true" then
if len(client) = 0 then
receivedtable = "received_0"
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"
else
receivedtable = "received_"&client
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"
end if
else
receivedtable = "received_"&session("clientid")
arrivaldatetime = " arrivaldatetime >= '"&dfrom&"' and arrivaldatetime <= '"&dto&"'"
end if
if len(client) = 0 then clientsql = "" else clientsql = " and client = '"&client&"'"
if len(shortcode) = 0 then shortcodesql = "" else shortcodesql = " and destination_adr = '"&shortcode&"'"
if len(keyword) = 0 then
keywordsql = ""
else
if ubound(split(keyword," ")) = 0 then
keywordsql = " and prime_keyword = '"&keyword&"'"
else
keywordsql = " and prime_keyword = '"&split(keyword," ")(0)&"' and sec_keyword='"&split(keyword," ")(1)&"'"
end if
end if
mySQL = "SELECT * FROM "&receivedtable&" WHERE
"&arrivaldatetime&clientsql&shortcodesql& amp;keywordsql&"
ORDER BY arrivaldatetime ASC"
set received = dbConn.execute(mySQL)
' Loop round the received messages and write out
while not received.eof
%>
You cannot add new info in this area You cannot add to info in this area You cannot delete your info in this area You cannot edit your info in this area You cannot create polls in this area You cannot vote in polls in this area