Done it! :-)

SELECT PK_ID,
        Name,
        Borough,
        CAST(Sat_Std AS Int)+CAST(Sat_Other AS Int) AS 'Open_Sat',
        CAST(Sun_Std AS Int)+CAST(Sun_Other AS Int) AS 'Open_Sun',
        Postcode

FROM LOH_Buildings


This makes the columns Ints but, who cares it works! Perhaps I should set
them to tinyint instead though? Mmmm...


Cheers,
Nick


:> -----Original Message-----
:> From: Nick Middleweek [mailto:[EMAIL PROTECTED]]
:> Sent: 29 August 2002 13:28
:> To: ActiveServerPages
:> Subject: Help with SQL and combining boolean fields with OR
:>
:>
:> Hello,
:>
:> I've got this SQL statement (that doesn't work)
:>
:> SELECT PK_ID,
:>      Name,
:>      Borough,
:>      (Sat_Std OR Sat_Other) as 'Open_Sat',
:>      (Sun_Std OR Sun_Other) as 'Open_Sun',
:>      Postcode
:>
:> FROM LOH_Buildings
:>
:>
:> I've got two fields that represent both Sat and Sun.
:>
:> I want to return one column that indicates whether either or
:> both fields are
:> True.
:>
:> Can I do this?
:>
:>
:> Thanks,
:> Nick
:>
:>
:> ---
:> You are currently subscribed to activeserverpages as:
:> [EMAIL PROTECTED]
:> To unsubscribe send a blank email to
:> %%email.unsub%%
:>


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to