tags:

views:

143

answers:

0

Dear friend , Now i'm getting new error invalid input syntax for type date:"" i have modified my query as suggested by u ,the query given below

**(select coalesce(V1.village_code,V2.village_code) as village_code, prev_issued, prev_recovered from (select village_code, sum (amt_issued) as prev_issued from Advance where CC_code =$P{cc_code} and issue_date < $P{fdate} and type_of_advance = 'Bank' group by village_code ) as V1 full outer join (select village_code, sum (actual_paid) as prev_recovered from Advance_recovery where CC_code = $P{cc_code} and date < $P{fdate} and type_of_advance = 'Bank' group by village_code ) as V2 on V1.village_code = V2.village_code ) as W1

            full outer join
            (select coalesce(V3.village_code,V4.village_code) as village_code, issued, recovered
                    from
                    (select village_code, sum (amt_issued) as issued
                            from Advance
                            where CC_code = $P{cc_code}
                            and type_of_advance = 'Bank'
                            and issue_date >= $P{fdate}::date
                            and issue_date <= $P{tdate}::date

                            group by village_code
                    ) as V3
                    full outer join
                    (select village_code, sum (actual_paid) as recovered
                            from Advance_recovery
                            where CC_code = $P{cc_code}
                            and type_of_advance = 'Bank'
                            and date >= $P{fdate}::date
                            and date <= $P{tdate}::date

                            group by village_code
                    ) as V4
                    on V3.village_code = V4.village_code
            ) as W2
            on W1.village_code = W2.village_code
    ) as W3

) as W6 where W6.village_code = Village.code and Village.area_code = Area.code group by Area.code, Area.name**

i have also set the default value for the date type parameter and remaining parameters as string , if i remove the parameter cc_code(string type ) in where clause query reads fine without any error.the problem is when comparing both date type and string type parameter in where clause ,i did many trial and error method still i cant come out of this problem ....please help me

related questions