Bonjour,
Voici ma requete :
SELECT DISTINCT I.TypeExpedition, '', L.Licencie, L.nom, L.CodeSAP,
ND.Type_location, A.Connexion, A.Diametre_txt as Diametre,
A.Extremite, CASE A.weight_lbft_min WHEN -1 THEN 'ALL' ELSE A.weight_lbft_min END as weight, A.thickness_inch_min as thickness, '', '', ND.Prix_Jour,
cast(datepart(dd,ND.Date_Debut)as varchar)+ char(47)+
cast(datepart(mm,ND.Date_Debut)as varchar)+ char(47)+
cast(datepart(yy,ND.Date_Debut) as varchar) As Date_Expe, ND.Nbre_Jour_Facture,
cast(datepart(dd,ND.Date_Debut)as varchar)+ char(47)+
cast(datepart(mm,ND.Date_Debut)as varchar)+ char(47)+
cast(datepart(yy,ND.Date_Debut) as varchar) As Debut_Loc,
cast(datepart(dd,ND.Date_Fin)as varchar)+ char(47)+
cast(datepart(mm,ND.Date_Fin)as varchar)+ char(47)+
cast(datepart(yy,ND.Date_Fin) as varchar) As Date_Fin,
ND.Montant_Aller + ND.Montant_Retour as Transport,
ND.Montant_Administratif, ND.Montant_Total, ND.Montant_Total as Montant_HT, '',
ND.Montant_Total as Montant_TTC, cast(datepart(dd,ND.Date_Commande)as varchar)+ char(47)+
cast(datepart(mm,ND.Date_Commande)as varchar)+ char(47)+
cast(datepart(yy,ND.Date_Commande) as varchar) As Date_Commande,
cast(datepart(dd,M.Date_envoie)as varchar)+ char(47)+
cast(datepart(mm,M.Date_envoie)as varchar)+ char(47)+
cast(datepart(yy,M.Date_envoie) as varchar) As DateRep
FROM GDC_IMPRESSION I INNER JOIN GDC_LICENCIE L ON L.Licencie = I.Licencie
INNER JOIN GDC_NOTE_DEBIT ND ON ND.Licencie = L.Licencie
INNER JOIN GDC_APPLICATION A ON A.id_jeux = ND.Num_Jeu
INNER JOIN GDC_MAIL M ON I.num_affaire = M.num_affaire
WHERE ND.Date_Debut >= 01/01/2006 AND ND.Date_Fin >= 31/12/2006
voici le message d'erreur sur sql-serveur 2000 :
Serveur : Msg 8114, Niveau 16, État 5, Ligne 1
Error converting data type varchar to float.
Le problème se situe au niveau du case en effet mon champs weight retourne un float et j'aimerai que quand il soit egal à -1 il me retourne ALL comment puis je faire?
Merci d'avance
GrandNico
Partager