Skip to main content
johng58900177
Known Participant
June 20, 2020
Question

Query

  • June 20, 2020
  • 1 reply
  • 355 views

OK.  Why isn't this working?  I have ben out of CF since about 2008.

 

SELECT *
FROM PURCHASEORDERTABLE
WHERE shipdate IS '#dateformat(Now(), "MM/DD/YYYY")#' AND Company IS CP

 

Having an issue with the AND statement.

    This topic has been closed for replies.

    1 reply

    Community Expert
    June 20, 2020

    "IS" is not a valid comparison operator in SQL for what you're trying to do. Try:

    WHERE shipdate = '...' AND company = '...'

     

    I'm also not sure what you're doing with the company comparison - you can't just refer to variables without any sort of identifier so that SQL knows it's a variable. Where does CP come from? Are you trying to do something in CF to compare them?

     

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC
    johng58900177
    Known Participant
    June 21, 2020

    company is a database field and CP is a company.  There are 4 in the same DB.  So I am trying to get shippingdates for the company CP.  I have also tried your suggestion before posting. doesn't work.