VBA+mysql+date+between

VBA+mysql+date+between - VB/VBA/VBS - Programmation

Marsh Posté le 30-10-2003 à 16:30:36    

Bonjour,
 
Je veux faire un between avec des dates au format "jj/mm/aaaa" (et pas le aaaa-mm-jj de mysql).
Voici ma requete, mais elle ne fonctionne pas :
 

Code :
  1. "SELECT t_expeditions.expe_numero, " + _
  2.   "t_dechets.dech_libelle, " + _
  3.   "t_expeditions.expe_date_expe, " + _
  4.   "t_expeditions.expe_date_traitement_dis, " + _
  5.   "t_expeditions.expe_nb_contenants, " + _
  6.   "t_expeditions.expe_volume, " + _
  7.   "t_expeditions.expe_quantite, " + _
  8.   "t_transporteurs.transp_nom, " + _
  9.   "t_destinataires.dest_nom, " + _
  10.   "t_ateliers.atel_libelle, " + _
  11.   "t_contenants.cont_libelle, " + _
  12.   "t_utilisateurs.util_nom " + _
  13. ", DATE_FORMAT(t_expeditions.expe_date_expe, '%d/%m/%Y') AS date_fr " + _
  14. "FROM " + _
  15.   "t_expeditions, t_dechets, t_transporteurs, t_destinataires, t_ateliers, t_contenants, t_utilisateurs " + _
  16. "WHERE " + _
  17.   "( t_expeditions.expe_dechet_id=t_dechets.dech_id  ) " + _
  18.   "AND  ( t_expeditions.expe_util_id=t_utilisateurs.util_id  ) " + _
  19.   "AND  ( t_expeditions.expe_contenant_id=t_contenants.cont_id  )" + _
  20.   "AND  ( t_expeditions.expe_atelier_id=t_ateliers.atel_id  ) " + _
  21.   "AND  ( t_expeditions.expe_transp_id=t_transporteurs.transp_id  ) " + _
  22.   "AND  ( t_expeditions.expe_dest_id=t_destinataires.dest_id  ) " + _
  23.   "AND  (" + _
  24.   "date_fr BETWEEN '01/01/2003' AND '31/01/2003')"


 
Quelqu'un peux m'aider ?
 
Je précise que là pour tester les dates sont en dur dans la requete, mais le but c'est de les récupérer d'une feuille excel (ou elles sont au format jj/mm/aaaa)


Message édité par matt276 le 30-10-2003 à 16:32:04
Reply

Marsh Posté le 30-10-2003 à 16:30:36   

Reply

Marsh Posté le 30-10-2003 à 16:46:59    

je sais pas si t'as le choix du format dans la requête, à ta place, j'essaierais vraiment de t'adapter au format aaaa-mm-jj.


---------------
Whichever format the fan may want to listen is fine with us – vinyl, wax cylinders, shellac, 8-track, iPod, cloud storage, cranial implants – just as long as it’s loud and rockin' (Billy Gibbons, ZZ Top)
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed