11/08/2015, 14:44
celilpartal
SELECT tbl_satis.musteri_id, tbl_satis.musteri_telefon, tbl_satis.Alacak, tbl_satis.[1t_tarih]
FROM tbl_satis;
WHERE
(((tbl_satis.[1t_tarih])<=Date()) AND ((tbl_satis.[1t_o_tutar])<[1t_tutar])) OR (((tbl_satis.[1t_o_tutar]) Is Null)) OR (((tbl_satis.[2t_tarih])<=Date()) AND ((tbl_satis.[2t_o_tutar])<[2t_tutar])) OR (((tbl_satis.[2t_o_tutar]) Is Null) OR (((tbl_satis.[3t_tarih])<=Date()) AND ((tbl_satis.[3t_o_tutar])<[3t_tutar])) OR (((tbl_satis.[3t_o_tutar]) Is Null) OR (((tbl_satis.[4t_tarih])<=Date()) AND ((tbl_satis.[4t_o_tutar])<[4t_tutar])) OR (((tbl_satis.[4t_o_tutar]) Is Null) OR (((tbl_satis.[5t_tarih])<=Date()) AND ((tbl_satis.[5t_o_tutar])<[5t_tutar])) OR (((tbl_satis.[5t_o_tutar]) Is Null) OR (((tbl_satis.[6t_tarih])<=Date()) AND ((tbl_satis.[6t_o_tutar])<[6t_tutar])) OR (((tbl_satis.[6t_o_tutar]) Is Null) OR (((tbl_satis.[7t_tarih])<=Date()) AND ((tbl_satis.[7t_o_tutar])<[7t_tutar])) OR (((tbl_satis.[7t_o_tutar]) Is Null) OR (((tbl_satis.[8t_tarih])<=Date()) AND ((tbl_satis.[8t_o_tutar])<[8t_tutar])) OR (((tbl_satis.[8t_o_tutar]) Is Null) OR (((tbl_satis.[9t_tarih])<=Date()) AND ((tbl_satis.[9t_o_tutar])<[9t_tutar])) OR (((tbl_satis.[9t_o_tutar]) Is Null) OR (((tbl_satis.[10t_tarih])<=Date()) AND ((tbl_satis.[10t_o_tutar])<[10t_tutar])) OR (((tbl_satis.[10t_o_tutar]) Is Null) OR (((tbl_satis.[11t_tarih])<=Date()) AND ((tbl_satis.[11t_o_tutar])<[11t_tutar])) OR (((tbl_satis.[11t_o_tutar]) Is Null) OR (((tbl_satis.[12t_tarih])<=Date()) AND ((tbl_satis.[12t_o_tutar])<[12t_tutar])) OR (((tbl_satis.[12t_o_tutar]) Is Null) OR (((tbl_satis.[13t_tarih])<=Date()) AND ((tbl_satis.[13t_o_tutar])<[13t_tutar])) OR (((tbl_satis.[13t_o_tutar]) Is Null) )OR (((tbl_satis.[14t_tarih])<=Date()) AND ((tbl_satis.[14t_o_tutar])<[14t_tutar])) OR (((tbl_satis.[14t_o_tutar]) Is Null) OR (((tbl_satis.[15t_tarih])<=Date()) AND ((tbl_satis.[15t_o_tutar])<[15t_tutar])) OR (((tbl_satis.[15t_o_tutar]) Is Null) OR (((tbl_satis.[16t_tarih])<=Date()) AND ((tbl_satis.[16t_o_tutar])<[16t_tutar])) OR (((tbl_satis.[16t_o_tutar]) Is Null) OR (((tbl_satis.[17t_tarih])<=Date()) AND ((tbl_satis.[17t_o_tutar])<[17t_tutar])) OR (((tbl_satis.[17t_o_tutar]) Is Null) OR (((tbl_satis.[18t_tarih])<=Date()) AND ((tbl_satis.[18t_o_tutar])<[18t_tutar])) OR (((tbl_satis.[18t_o_tutar]) Is Null) OR (((tbl_satis.[19t_tarih])<=Date()) AND ((tbl_satis.[19t_o_tutar])<[19t_tutar])) OR (((tbl_satis.[19t_o_tutar]) Is Null) OR (((tbl_satis.[20t_tarih])<=Date()) AND ((tbl_satis.[20t_o_tutar])<[20t_tutar])) OR (((tbl_satis.[20t_o_tutar]) Is Null) OR (((tbl_satis.[21t_tarih])<=Date()) AND ((tbl_satis.[21t_o_tutar])<[21t_tutar])) OR (((tbl_satis.[21t_o_tutar]) Is Null) OR (((tbl_satis.[22t_tarih])<=Date()) AND ((tbl_satis.[22t_o_tutar])<[22t_tutar])) OR (((tbl_satis.[22t_o_tutar]) Is Null) OR (((tbl_satis.[23t_tarih])<=Date()) AND ((tbl_satis.[23t_o_tutar])<[23t_tutar])) OR (((tbl_satis.[23t_o_tutar]) Is Null) OR (((tbl_satis.[24t_tarih])<=Date()) AND ((tbl_satis.[24t_o_tutar])<[24t_tutar])) OR (((tbl_satis.[24t_o_tutar]) Is Null );
bu sorguyu yazdıgımda karmaşık diyor.kodu kısaltabilirmiyiz.
yani şöyleki 1 taksit tarihi bugunden önce ise ve 1. taksit ödenen tutarı 1.taksit tutarından kücük ise yada boş ise için yazdım 1-24 taksit için 24 tane yani.
ancak çok karmaşık hatası veriyor
yardımcı olabilirmisiniz
FROM tbl_satis;
WHERE
(((tbl_satis.[1t_tarih])<=Date()) AND ((tbl_satis.[1t_o_tutar])<[1t_tutar])) OR (((tbl_satis.[1t_o_tutar]) Is Null)) OR (((tbl_satis.[2t_tarih])<=Date()) AND ((tbl_satis.[2t_o_tutar])<[2t_tutar])) OR (((tbl_satis.[2t_o_tutar]) Is Null) OR (((tbl_satis.[3t_tarih])<=Date()) AND ((tbl_satis.[3t_o_tutar])<[3t_tutar])) OR (((tbl_satis.[3t_o_tutar]) Is Null) OR (((tbl_satis.[4t_tarih])<=Date()) AND ((tbl_satis.[4t_o_tutar])<[4t_tutar])) OR (((tbl_satis.[4t_o_tutar]) Is Null) OR (((tbl_satis.[5t_tarih])<=Date()) AND ((tbl_satis.[5t_o_tutar])<[5t_tutar])) OR (((tbl_satis.[5t_o_tutar]) Is Null) OR (((tbl_satis.[6t_tarih])<=Date()) AND ((tbl_satis.[6t_o_tutar])<[6t_tutar])) OR (((tbl_satis.[6t_o_tutar]) Is Null) OR (((tbl_satis.[7t_tarih])<=Date()) AND ((tbl_satis.[7t_o_tutar])<[7t_tutar])) OR (((tbl_satis.[7t_o_tutar]) Is Null) OR (((tbl_satis.[8t_tarih])<=Date()) AND ((tbl_satis.[8t_o_tutar])<[8t_tutar])) OR (((tbl_satis.[8t_o_tutar]) Is Null) OR (((tbl_satis.[9t_tarih])<=Date()) AND ((tbl_satis.[9t_o_tutar])<[9t_tutar])) OR (((tbl_satis.[9t_o_tutar]) Is Null) OR (((tbl_satis.[10t_tarih])<=Date()) AND ((tbl_satis.[10t_o_tutar])<[10t_tutar])) OR (((tbl_satis.[10t_o_tutar]) Is Null) OR (((tbl_satis.[11t_tarih])<=Date()) AND ((tbl_satis.[11t_o_tutar])<[11t_tutar])) OR (((tbl_satis.[11t_o_tutar]) Is Null) OR (((tbl_satis.[12t_tarih])<=Date()) AND ((tbl_satis.[12t_o_tutar])<[12t_tutar])) OR (((tbl_satis.[12t_o_tutar]) Is Null) OR (((tbl_satis.[13t_tarih])<=Date()) AND ((tbl_satis.[13t_o_tutar])<[13t_tutar])) OR (((tbl_satis.[13t_o_tutar]) Is Null) )OR (((tbl_satis.[14t_tarih])<=Date()) AND ((tbl_satis.[14t_o_tutar])<[14t_tutar])) OR (((tbl_satis.[14t_o_tutar]) Is Null) OR (((tbl_satis.[15t_tarih])<=Date()) AND ((tbl_satis.[15t_o_tutar])<[15t_tutar])) OR (((tbl_satis.[15t_o_tutar]) Is Null) OR (((tbl_satis.[16t_tarih])<=Date()) AND ((tbl_satis.[16t_o_tutar])<[16t_tutar])) OR (((tbl_satis.[16t_o_tutar]) Is Null) OR (((tbl_satis.[17t_tarih])<=Date()) AND ((tbl_satis.[17t_o_tutar])<[17t_tutar])) OR (((tbl_satis.[17t_o_tutar]) Is Null) OR (((tbl_satis.[18t_tarih])<=Date()) AND ((tbl_satis.[18t_o_tutar])<[18t_tutar])) OR (((tbl_satis.[18t_o_tutar]) Is Null) OR (((tbl_satis.[19t_tarih])<=Date()) AND ((tbl_satis.[19t_o_tutar])<[19t_tutar])) OR (((tbl_satis.[19t_o_tutar]) Is Null) OR (((tbl_satis.[20t_tarih])<=Date()) AND ((tbl_satis.[20t_o_tutar])<[20t_tutar])) OR (((tbl_satis.[20t_o_tutar]) Is Null) OR (((tbl_satis.[21t_tarih])<=Date()) AND ((tbl_satis.[21t_o_tutar])<[21t_tutar])) OR (((tbl_satis.[21t_o_tutar]) Is Null) OR (((tbl_satis.[22t_tarih])<=Date()) AND ((tbl_satis.[22t_o_tutar])<[22t_tutar])) OR (((tbl_satis.[22t_o_tutar]) Is Null) OR (((tbl_satis.[23t_tarih])<=Date()) AND ((tbl_satis.[23t_o_tutar])<[23t_tutar])) OR (((tbl_satis.[23t_o_tutar]) Is Null) OR (((tbl_satis.[24t_tarih])<=Date()) AND ((tbl_satis.[24t_o_tutar])<[24t_tutar])) OR (((tbl_satis.[24t_o_tutar]) Is Null );
bu sorguyu yazdıgımda karmaşık diyor.kodu kısaltabilirmiyiz.
yani şöyleki 1 taksit tarihi bugunden önce ise ve 1. taksit ödenen tutarı 1.taksit tutarından kücük ise yada boş ise için yazdım 1-24 taksit için 24 tane yani.
ancak çok karmaşık hatası veriyor
yardımcı olabilirmisiniz