i think u have made some mistake in the query. Just try to avoid the
highlighted red part and check it out.


Dim emira, siz, price, rentprice As String

emira = emi.SelectedItem.Text (Place)

siz = size.SelectedItem.Text (Eg: 0,1, 2, 3)

Dim strsql As String

strsql =
"Select distinct sno,companyname,mobileno from Real where Emi='" & emira & "'
and count('" & siz & "')>0 and *'" & siz &* "'price<='" & price & "'
and '"& siz &
"'price>'" & rentprice & "' and area='" & area.SelectedItem.Text & "'"




that is your final query can be as follows if any problem u can check out
with he single and double quotes:
"Select distinct sno,companyname,mobileno from Real where Emi='" & emira & "'
and count('" & siz & "')>0 and price<='" & price & "' and price>'" &
rentprice & "' and area='" & area.SelectedItem.Text & "'"


On 22/06/2009, Jeena Ajiesh <[email protected]> wrote:
>
>  Hi all,
> While i was trying to select some records from db it show 1 error,
>
> *An aggregate may not appear in the WHERE clause unless it is in a
> subquery contained in a HAVING clause or a select list, and the column being
> aggregated is an outer reference.
> *
> How can i solve this problem?
>
> My sql query is as follows
> **
>
> Dim emira, siz, price, rentprice As String
>
> emira = emi.SelectedItem.Text (Place)
>
> siz = size.SelectedItem.Text (Eg: 0,1, 2, 3)
>
> Dim strsql As String
>
> strsql =
> "Select distinct sno,companyname,mobileno from Real where Emi='" & emira &
> "' and count('" & siz & "')>0 and '" & siz & "'price<='" & price & "' and
> '" & siz & "'price>'" & rentprice & "' and area='" &
> area.SelectedItem.Text & "'"
> Can anyone help me to modify this query?
>
> --
> ****************
> Thanks & Regards,
> Jeena Ajiesh
> Email: [email protected]
>          [email protected]
>
>
>

Reply via email to