BookmarkSubscribeRSS Feed
Beto16
Obsidian | Level 7
Hi I have 2 tables that I need to join they don't have like variables ... what I'm using is id and date and time.. here is example

From table A join table B
On B.ID = A.Id
And a.date=b.date and a.time between b.time1 and b.time2
);run:


the data looks like this table A
Id. Date time

A. 05/26/16. 11:53:00
B. 05/29/16. 02:33:00

table B
Id. Date time. Time1. Time2
11
A. 05/26/16. 11:55:00 11:50:00. 12:00:00
B. 05/29/16. 02:35:00. 02:35:00. 02:40:00


What I'm doing is if the time from table A fell within the time range from table B time1 and time 2 ...I'm getting results but not sure if I'm getting everything thanks again for the help


2 REPLIES 2
LinusH
Tourmaline | Level 20
Your syntax looks OK given that I understood your requirement.
If you want to feel confident with the result, control it.
Start with the result - are the returned records correct?
The look to you source data, pick rows and see if they would match your criteria, and compare with your result.
Data never sleeps
Reeza
Super User

You need to develop test cases. 

Then check that each case is returning the correct number

of records. Make sure to test edge cases - ones with no

matches either by ID or by time, missing data, and/or a large number of matches. 

 

Also, test each case individually

and then as a set. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2209 views
  • 1 like
  • 3 in conversation