Impressive @FreelanceReinh!
I'm sorry for continuing to drop (stupid) questions and problems in your direction.
When I run the full code from your last post:
proc sql;
create table Data_komplet_Geo as
select a.*,
(select count(*) from Data_komplet b where .z<intnx('dtyear',a.eventtime,0)<=b.createdtime<=a.eventtime
& 0<=geodist(input(incident_northing,32.), input(incident_easting,32.), b.latitude, b.longitude)<=0.360
& (upcase(left(b.'247'n)) eqt 'Y' | upcase(left(put(datepart(a.eventtime),downame.)))=upcase(left(b.Type)) & b.open<=timepart(a.eventtime)<=b.close)) as d0_360,
(select count(*) from Data_komplet b where .z<intnx('dtyear',a.eventtime,0)<=b.createdtime<=a.eventtime
& 0.360<geodist(input(incident_northing,32.), input(incident_easting,32.), b.latitude, b.longitude)<=1.08
& (upcase(left(b.'247'n)) eqt 'Y' | upcase(left(put(datepart(a.eventtime),downame.)))=upcase(left(b.Type)) & b.open<=timepart(a.eventtime)<=b.close)) as d360_1080,
(select count(*) from Data_komplet b where .z<intnx('dtyear',a.eventtime,0)<=b.createdtime<=a.eventtime
& 1.08<geodist(input(incident_northing,32.), input(incident_easting,32.), b.latitude, b.longitude)<=1.8
& (upcase(left(b.'247'n)) eqt 'Y' | upcase(left(put(datepart(a.eventtime),downame.)))=upcase(left(b.Type)) & b.open<=timepart(a.eventtime)<=b.close)) as d1080_1800
from Final_database a;
quit;
I get the new following error messages:
ERROR: Expression using less than or equal (<=) has components that are of different data types. ERROR: Expression using greater than or equal (>=) has components that are of different data types. ERROR: Expression using less than or equal (<=) has components that are of different data types. ERROR: Expression using greater than or equal (>=) has components that are of different data types. ERROR: Expression using less than or equal (<=) has components that are of different data types. ERROR: Expression using greater than or equal (>=) has components that are of different data types.
Is that because of the format or type of my different time variables used?
Eventtime: type = num, format = DATETIME19. (shown in my database as: "14MAY2018:13:15:10" from Final_database)
Createdtime: type = num, format = DATETIME18. (shown in my database as: "11JAN13:09:52:00" from Data_komplet)
Open: type = char, format = $CHAR8. (shown in my database as: "8:30:00" from Data_komplet)
Close: type = char, format = $CHAR8. (shown in my database as: "16:00:00" from Data_komplet)
Thanks once again! 🙂
... View more