Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. masb13

    Counting Multiple Columns that meet a specified condition

    Perfect. Thanks a lot PHV. I also added in the following so that the query doesn't return a record where none of the conditions are met. WHERE (PI_EXPIRY_DATE<>0) OR (WC_expiry_date<>0) OR (EL_expiry_date<>0) OR (CAR_expiry_date<>0);
  2. masb13

    Counting Multiple Columns that meet a specified condition

    Apologies, there was an error in my original description of the problem. It should have said: ... Among the columns are four columns that hold the expiry dates for different types of insurance. I need to write a query that counts the number of these columns, within each record, where the date...
  3. masb13

    Counting Multiple Columns that meet a specified condition

    Thanks PHV. This is what the SQL statement looks like in my DB: SELECT Company_name, Count(*) AS NumOfExpiry FROM Company WHERE PI_EXPIRY_DATE<Now()+60 OR WC_expiry_date<Now()+60 OR EL_expiry_date<Now()+60 OR CAR_expiry_date<Now()+60 GROUP BY Company_name It runs and returns the company name...
  4. masb13

    Counting Multiple Columns that meet a specified condition

    I have a table with a large number of columns. Among the columns are four columns that hold the expiry dates for different types of insurance. I need to write a query that counts the number of records, where the date difference on any of the four columns, between the date now and the expiry...

Part and Inventory Search

Back
Top