code mssql #1

Open
opened 2025-03-29 11:02:09 +01:00 by chrisadmin · 2 comments
Owner

SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
where cot.datec LIKE'2025-03-26%'
ORDER BY nom ASC

SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh FROM llx_adherent as adh LEFT JOIN llx_subscription as cot ON cot.fk_adherent = adh.rowid where cot.datec LIKE'2025-03-26%' ORDER BY nom ASC
chrisadmin added this to the Projet tableau Dolibarr project 2025-03-29 11:02:09 +01:00
Author
Owner

SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
where cot.datec LIKE'2025-03-26%'
ORDER BY nom ASC

Avec CAST
SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
where CAST(cot.datec AS DATE) BETWEEN CAST('2025-03-26' AS DATE) AND CAST('2025-03-28' AS DATE)
ORDER BY nom ASC

> SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh > FROM llx_adherent as adh > LEFT JOIN llx_subscription as cot > ON cot.fk_adherent = adh.rowid > where cot.datec LIKE'2025-03-26%' > ORDER BY nom ASC **Avec CAST** SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh FROM llx_adherent as adh LEFT JOIN llx_subscription as cot ON cot.fk_adherent = adh.rowid where CAST(cot.datec AS DATE) BETWEEN CAST('2025-03-26' AS DATE) AND CAST('2025-03-28' AS DATE) ORDER BY nom ASC
Author
Owner

SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
where cot.datec LIKE'2025-03-26%'
ORDER BY nom ASC

Avec CAST
SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
where CAST(cot.datec AS DATE) BETWEEN CAST('2025-03-26' AS DATE) AND CAST('2025-03-28' AS DATE)
ORDER BY nom ASC

maj
$sql4 = "SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh
FROM llx_adherent as adh
LEFT JOIN llx_subscription as cot
ON cot.fk_adherent = adh.rowid
WHERE CAST(cot.datec AS DATE) BETWEEN CAST('$jourdeb' AS DATE) AND CAST('$jourfin' AS DATE)
ORDER BY nom ASC";

$tab_cot = db_lire_lignes_dans_tableau($sql4);

> > SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh > > FROM llx_adherent as adh > > LEFT JOIN llx_subscription as cot > > ON cot.fk_adherent = adh.rowid > > where cot.datec LIKE'2025-03-26%' > > ORDER BY nom ASC > > **Avec CAST** > SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh > FROM llx_adherent as adh > LEFT JOIN llx_subscription as cot > ON cot.fk_adherent = adh.rowid > where CAST(cot.datec AS DATE) BETWEEN CAST('2025-03-26' AS DATE) AND CAST('2025-03-28' AS DATE) > ORDER BY nom ASC maj $sql4 = "SELECT adh.rowid, lastname as nom, firstname as prenom, cot.datec as date_adh FROM llx_adherent as adh LEFT JOIN llx_subscription as cot ON cot.fk_adherent = adh.rowid WHERE CAST(cot.datec AS DATE) BETWEEN CAST('$jourdeb' AS DATE) AND CAST('$jourfin' AS DATE) ORDER BY nom ASC"; $tab_cot = db_lire_lignes_dans_tableau($sql4);
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: chrisadmin/Dolibar_php#1