Hi,

I need to exclude any rows where the ASX_Prices.Date is a weekend. The date format is yyyy/mm/dd 2013/03/17.

Ideally I would like to add another WHERE clause.

WHERE ASX_Prices.Date !=weekend date?????

$sql="SELECT Distinct ASX_Prices.ASX_Code, ASX_Prices.ASX_Price, ASX_Prices.Date, Company_Information.Company_Name
        FROM ASX_Prices, Company_Information 
        WHERE ASX_Prices.ASX_Code = Company_Information.ASX_Code 
        AND DateDiff(now(), ASX_Prices.Date)<=7
        ORDER BY ASX_Prices.ASX_Code ASC, ASX_Prices.Date ASC";

Thanks

Matt.

Sorry I resolved this.

AND DAYOFWEEK(ASX_Prices.Date) NOT IN (1,7)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.