BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cnilsen
Quartz | Level 8

HI..

 

I have a limited knowledge of SAS. I am an  AS400 developer who recently jumped to this platform when my company offered me the opportunity.

 

I am using EG (7.1) and trying to do a left join on 2 tables using a date field.

Table1 has a format of  20OCT2016:00:00:00

Table2 has a format of 20OCT2016

 

EG wants me to a manual join.. since there is no natural matching columns between the two tables.

I can connect the 2 date columns together and run it without errors, but my results show as NULL values. so the match didnt work

Can I extract(substring) the date only from table1 and do this?

 

 

Regards,

Chris 

- Chris N.
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Most likely, what you are seeing are formatted versions of the data values (not the actual values).

 

If that's the case, the issue is that one table contains a date-time combination but the other is just the date.  Try matching this way:

 

datepart(table1.fieldname) = table2.fieldname

 

It's the most likely way to resolve this, but sometimes it takes inspecting the data more closely.

View solution in original post

2 REPLIES 2
Astounding
PROC Star

Most likely, what you are seeing are formatted versions of the data values (not the actual values).

 

If that's the case, the issue is that one table contains a date-time combination but the other is just the date.  Try matching this way:

 

datepart(table1.fieldname) = table2.fieldname

 

It's the most likely way to resolve this, but sometimes it takes inspecting the data more closely.

cnilsen
Quartz | Level 8

Thanks for the help, that worked great!

 

As I start doing more programming, I'm sure I'll be posting out here quite a bit with questions. 

 

-Chris N.

 

- Chris N.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 912 views
  • 0 likes
  • 2 in conversation