
How to format Union Query
I have the following in a Union Query. But a report that runs off this doesn't
seem to know that some fields are Dates, some text and some numbers. I need to
format the following:
SchedETD and SchedETDCom: Date
SchedShipMode and SchedShipModeCom: Text
SchedUnits and SchedUnitsCom: Number (Fixed, no decimal).
___________________
SELECT PO, Counter, SchedETD, SchedShipMode, SchedUnits, POCom, CounterCom,
SchedETDCom, SchedShipModeCom, SchedUnitsCom
FROM SchedCompareqry1
UNION ALL SELECT PO, Counter, SchedETD, SchedShipMode, SchedUnits, Null, Null,
Null, Null, Null
FROM SchedCompareMissingqry2;
______________________
I can't seem to do it. The reason why this seems to have to be done is, I have
the following code in the report:
If SchedUnits = SchedUnitsCom Then
Me.SchedBox.Visible = 0
Else
Me.SchedBox.Visible = 1
End If
If SchedShipMode = SchedShipModeCom Then
Me.ModeBox.Visible = 0
Else
Me.ModeBox.Visible = 1
End If
It doesn't seem to recognize that the fields are dates. I also wish to
subtract the two dates: =[SchedETD]-[SchedETDCom].
It can't do that as of now. All this used to work when it was based on a
regular query. But since I changed to a union query (for some other data), it
failed. Thanks,
Matt