L
lovely_angel_for_you
Hi,
I have situation in creating a SQL query, I think what I want to
achieve can be done. I have two tables,
CaseData >> Date(Date), Case(string), Caller(String)
People >> Caller(String), City(String)
Now I want to display the data from CaseData, where Caller is From City
I select, within a select range.
I can create the list of all cases from CaseDate within a date range
using this.
Set rdset1 = conn.Execute("SELECT * FROM CaseData Where Date>=#" &
Format$(StartDate.Text, "mm/dd/yyyy") & "# AND Date<=#" &
Format$(EndDate.Text, "mm/dd/yyyy") & "# Order By Date, Time")
And I can create the list of Callers from a City using this
Set rdset2 = conn.Execute("Select * From People Where City='" &
CitySelected & "'")
Now can we join these two queries. As right now I am creating the list
of Callers, then do while till the rdset2.eof, I am then creating the
list of cases, and printing them using do while not rdset1.eof.
However as I want to show the data in order by date, I am not able to
accomplish that. And also it is causing the number of queries to
database increase.
I am pretty sure that there is a way to bind these queries together,
how I dont know. Maybe using Join or some other sql command. Please
assist me in this one.
Waiting eagerly.
Regards
Lovely
I have situation in creating a SQL query, I think what I want to
achieve can be done. I have two tables,
CaseData >> Date(Date), Case(string), Caller(String)
People >> Caller(String), City(String)
Now I want to display the data from CaseData, where Caller is From City
I select, within a select range.
I can create the list of all cases from CaseDate within a date range
using this.
Set rdset1 = conn.Execute("SELECT * FROM CaseData Where Date>=#" &
Format$(StartDate.Text, "mm/dd/yyyy") & "# AND Date<=#" &
Format$(EndDate.Text, "mm/dd/yyyy") & "# Order By Date, Time")
And I can create the list of Callers from a City using this
Set rdset2 = conn.Execute("Select * From People Where City='" &
CitySelected & "'")
Now can we join these two queries. As right now I am creating the list
of Callers, then do while till the rdset2.eof, I am then creating the
list of cases, and printing them using do while not rdset1.eof.
However as I want to show the data in order by date, I am not able to
accomplish that. And also it is causing the number of queries to
database increase.
I am pretty sure that there is a way to bind these queries together,
how I dont know. Maybe using Join or some other sql command. Please
assist me in this one.
Waiting eagerly.
Regards
Lovely