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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VARCHAR2

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
US
Not sure if this is the correct forum to post this but am trying.
Have a union statment that the first query holds the a varchar2 field (amenity_code) the second query does not request for that field. I am getting a expression must be of same datatype as corresponding expression.

For example:
1st query:
SELECT
1 AS SOLVE_ORDER
,UNITS.UNIT_BUILDING_NUM AS BUILD_NUM
, UNITS.UNIT_NUM AS UNIT_NUM
, UNITS.UNIT_ID AS UNIT_ID
, UNITS.UNIT_MARKET_RENT AS MARKET_RENT
, UNIT_TYPES.UNIT_TYPE_CODE AS UNIT_TYPE_CODE
, AMENITIES.AMENITY_CODE as Amenity_code


2nd query:
SELECT
4 AS SOLVE_ORDER
, UNITS.UNIT_BUILDING_NUM AS BUILD_NUM
, UNITS.UNIT_NUM AS UNIT_NUM
, UNITS.UNIT_ID AS UNIT_ID
, UNITS.UNIT_MARKET_RENT AS MARKET_RENT
, UNIT_TYPES.UNIT_TYPE_CODE AS UNIT_TYPE_CODE
, 'z' as Amenity_code

thanks
 
Never mind, seems to be a date issue. The units.unit_makeready_date is not the same in query 2. Isn't '01-dec-1950' a DATE format?
 
Well, yes and no.
I assume you are using Oracle, in which case the default date format would be '1-DEC-50' (unless overridden in your instance).
Try replacing '01-dec-1950' with
TO_DATE('01-DEC-1950','DD-MON-YYYY')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top