I’m a MySQL guy these days and have a .NET project that I’m working on and can’t figure out how to dynamically generate and return a field(column) from a table, based on two fields in the table.
There are two fields bRentable and bRented in the Units table and I need to return a field called reserved if bRentable and bRented are equal to zero.
Here is the SQL I have so far
/* Units Query */
SELECT Units.UnitID, Units.dcWidth, Units.dcLength, Units.dcPushRate,
Units.dcStdRate, Units.UnitTypeID, UnitTypes.sTypeName, Units.bRentable
FROM Units
INNER JOIN UnitTypes ON Units.UnitTypeID = UnitTypes.UnitTypeID
Any help would be greatly appreciated.
You can add the following as another column to your select statement:
Edit: Updated based on OPs comment: