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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2010 views
  • 1 like
  • 3 in conversation