Bonjour à tous,
J'utilise une base de données PostgreSQL pour mon site et je voudrais afficher seulement dans une zone répétée des données dont le nombre de jour après leur publication est inférieur à 31. Voici ma requête de base que je veux transformer pour répondre à mon besoin :
La requête :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| SELECT
recherche_jdm.id_publication AS id_publication,
recherche_jdm.fk_autorite_contractante AS fk_autorite_contractante,
recherche_jdm.fk_id_region AS fk_id_region,
recherche_jdm.fk_id_type_de_procedure AS fk_id_type_de_procedure,
recherche_jdm.fk_nature_de_prestation AS fk_nature_de_prestation,
recherche_jdm.date_publication_definitive AS date_publication_definitive,
recherche_jdm.date_de_cloture AS date_de_cloture,
recherche_jdm.heure_de_cloture AS heure_de_cloture,
recherche_jdm.titre AS titre,
recherche_jdm.etat_avis AS etat_avis,
recherche_jdm.montant_previsionnel_marche AS montant_previsionnel_marche,
recherche_jdm.type_publication AS type_publication
FROM
recherche_jdm
WHERE
recherche_jdm.etat_avis = 4 AND CAST(recherche_jdm.date_publication_definitive AS DATE) BETWEEN '{Param2}' AND '{Param3}'
ORDER BY
date_publication_definitive DESC |
Initialisation et exécution de la requête de recherche :
HExécuteRequêteSQL(REQ_Toutes_Consultations,"SELECT * FROM recherche_jdm WHERE recherche_jdm.etat_avis = 4 AND CAST(recherche_jdm.date_publication_definitive AS DATE) BETWEEN '"+"20160101"+"' AND '"+DateDuJour+"'ORDER BY date_publication_definitive DESC")
Partager