Click here to Skip to main content
15,867,973 members
Home / Discussions / Database
   

Database

 
GeneralRe: ibtogo64.dll error Pin
Dhyanga25-Sep-22 7:52
Dhyanga25-Sep-22 7:52 
GeneralRe: ibtogo64.dll error Pin
Richard MacCutchan25-Sep-22 8:03
mveRichard MacCutchan25-Sep-22 8:03 
GeneralRe: ibtogo64.dll error Pin
Dhyanga25-Sep-22 8:15
Dhyanga25-Sep-22 8:15 
GeneralRe: ibtogo64.dll error Pin
Richard Deeming25-Sep-22 21:45
mveRichard Deeming25-Sep-22 21:45 
QuestionJust trying to get the count that meets the criteria Pin
jkirkerx4-Sep-22 13:58
professionaljkirkerx4-Sep-22 13:58 
AnswerRe: Just trying to get the count that meets the criteria Pin
CHill605-Sep-22 2:28
mveCHill605-Sep-22 2:28 
GeneralRe: Just trying to get the count that meets the criteria Pin
jkirkerx5-Sep-22 8:11
professionaljkirkerx5-Sep-22 8:11 
GeneralRe: Just trying to get the count that meets the criteria Pin
jkirkerx5-Sep-22 8:41
professionaljkirkerx5-Sep-22 8:41 
Thanks @Chill60

Works like a champ!

I thought more about what you said about dates and strings. I've concluded that in PHP8, or really what's stored in the database (SQL Server) as a Date or DATETIME column, is just a string formatted to a particular ISO format, labeled as something special or unique. I could be wrong here, there really isn't much help or support available, and I'm on my own here with PHP8. I've seemed to have gone so far beyond the common PHP programmer, that I'm in uncharted waters.

This code gets a list of qualified swimming pool designers that have actual projects (Swimming Pools) to pay commission on, so they get their paycheck. I got tired of going through the entire pool of designers that didn't have projects to test with.
$designerId = (rtrim($row1[0]));

$query2 = "
WITH cte AS 
(
    SELECT distinct
    project.project_no
    FROM project
    RIGHT JOIN commission_summary ON commission_summary.project_no = project.project_no<br />
    WHERE project.sales_no = '$designerId'
    AND (project.status = 'construction' OR project.status = 'finished') 
    AND (commission_summary.startup_check_date is NULL OR CONVERT(char(10), commission_summary.startup_check_date, 120) = '1900-01-01' OR CONVERT(char(10), commission_summary.startup_check_date, 120) >= '2021-01-01') 
    AND (commission_summary.finished_check_date is NULL OR CONVERT(char(10), commission_summary.finished_check_date, 120) = '1900-01-01' OR CONVERT(char(10), commission_summary.finished_check_date, 120) >= DATEADD(month, -1, GETDATE()) )
)<br />
SELECT COUNT(*) FROM cte";

$result2 = sqlsrv_query($conn, $query2) or die(" getDesignersWithProjectsKeyValuesByLastName " . LINE . " - " . $query2 . " - "  .  print_r(sqlsrv_errors()));
if (sqlsrv_has_rows($result2)) {

    $row2 = sqlsrv_fetch_array($result2);
    $projectCount = $row2[0];

    if ($projectCount > 0) {

        $keyValue = new KeyValue();
        $keyValue->setKey(rtrim($row1[1]));
        $keyValue->setValue(rtrim($row1[0]));
        $keyValues->add($keyValue);

    }

}
If it ain't broke don't fix it
Discover my world at jkirkerx.com

GeneralRe: Just trying to get the count that meets the criteria Pin
CHill605-Sep-22 21:05
mveCHill605-Sep-22 21:05 
GeneralRe: Just trying to get the count that meets the criteria Pin
CHill605-Sep-22 21:07
mveCHill605-Sep-22 21:07 
GeneralRe: Just trying to get the count that meets the criteria Pin
jkirkerx6-Sep-22 5:37
professionaljkirkerx6-Sep-22 5:37 
GeneralRe: Just trying to get the count that meets the criteria Pin
Richard Deeming6-Sep-22 21:23
mveRichard Deeming6-Sep-22 21:23 
GeneralRe: Just trying to get the count that meets the criteria Pin
jkirkerx7-Sep-22 6:22
professionaljkirkerx7-Sep-22 6:22 
GeneralRe: Just trying to get the count that meets the criteria Pin
CHill607-Sep-22 23:59
mveCHill607-Sep-22 23:59 
QuestionMSSQL select values in one row by group Pin
Sergey Makarov 20222-Sep-22 5:45
Sergey Makarov 20222-Sep-22 5:45 
AnswerRe: MSSQL select values in one row by group Pin
OriginalGriff2-Sep-22 5:47
mveOriginalGriff2-Sep-22 5:47 
GeneralRe: MSSQL select values in one row by group Pin
Sergey Makarov 20222-Sep-22 5:49
Sergey Makarov 20222-Sep-22 5:49 
QuestionAzure Synapse Data Flow Linked Data Set table not populating Pin
j11codep2-Sep-22 2:38
j11codep2-Sep-22 2:38 
GeneralAnyone here use Snowflake Pin
Mike Ahrens30-Aug-22 9:37
professionalMike Ahrens30-Aug-22 9:37 
GeneralRe: Anyone here use Snowflake Pin
PIEBALDconsult30-Aug-22 12:57
mvePIEBALDconsult30-Aug-22 12:57 
GeneralRe: Anyone here use Snowflake Pin
Mycroft Holmes30-Aug-22 12:59
professionalMycroft Holmes30-Aug-22 12:59 
GeneralRe: Anyone here use Snowflake Pin
PIEBALDconsult30-Aug-22 13:22
mvePIEBALDconsult30-Aug-22 13:22 
GeneralRe: Anyone here use Snowflake Pin
CHill601-Sep-22 3:25
mveCHill601-Sep-22 3:25 
GeneralRe: Anyone here use Snowflake Pin
CHill601-Sep-22 3:23
mveCHill601-Sep-22 3:23 
RantRe: Anyone here use Snowflake Pin
Eddy Vluggen1-Sep-22 3:49
professionalEddy Vluggen1-Sep-22 3:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.