Hello,
I would like to cast Breite1, Laenge, Staerke AS double that this query will work right.
In my sql they have the typ: varchar.
Sql_Search_String.Format("SELECT * FROM Angebot_Anfrage WHERE Angebot_Anfrage='%s' AND\
Typ>='%s' AND Typ<='%s' AND\
Staerke>='%s' AND Staerke<='%s' AND\
Breite1>='%s' AND Breite1<='%s' AND\
Laenge>='%s' AND Laenge<='%s'AND\
Gewicht>='%s' AND Gewicht<='%s' AND\
KdNr>='%s' AND KdNr<='%s' AND\
CONVERT(datetime,Ausstellungsdatum)>='%s' AND CONVERT(datetime,Ausstellungsdatum)<='%s' AND\
Guete LIKE '%s' AND Kennzahl_Auftrag_erhalten=1 \
ORDER BY Typ ASC, Abmessung ASC,\
Ausstellungsdatum DESC, Gewicht ASC,Nr ASC",\
str_Angebot_Anfrage,suche_Typ_von,suche_Typ_bis,\
suche_Staerke_von,suche_Staerke_bis,\
suche_Breite_von,suche_Breite_bis,\
suche_Laenge_von,suche_Laenge_bis,\
suche_Gewicht_von,suche_Gewicht_bis,\
suche_Kunde_von,suche_Kunde_bis,\
suche_AngebotsDatum_von,suche_AngebotsDatum_bis,\
suche_Artikelkurzbezeichnung,str_Auftrag_erhalten);
I tried this:
Sql_Search_String.Format("SELECT * FROM Angebot_Anfrage WHERE Angebot_Anfrage='%s' AND\
Typ>='%s' AND Typ<='%s' AND\
CAST(Staerke AS Double)>='%s' AND CAST(Staerke AS Double)<='%s' AND\
CAST(Breite1 AS Double)>='%s' AND CAST(Breite1 AS Double)<='%s' AND\........
will not work
Please help.
Thank you.
Best regards,
Thomas
P.S. Sql Server 2000