BookmarkSubscribeRSS Feed
Ranjeeta
Pyrite | Level 9

Hello I am writing a query in Microsoft SQL Server management studio and not sas but am getting an error with the statement below

I dont have training in SQL Wold someone be able to advise how to write the query corectly?

 

 

create table TAVIPx as select [WaitlistEntryID],[TAVIAccessSiteCD],[TransCathAorticValveInterventionIND]from [dbo].[CardiacReferralTAVIIntraProcedure];

3 REPLIES 3
Jagadishkatam
Amethyst | Level 16

Could you please post the error for better response.

 

as per the code provided I believe there is no space between [TransCathAorticValveInterventionIND] and from

so i updated the code to have space.

 

you may try it

 

create table TAVIPx as select [WaitlistEntryID],[TAVIAccessSiteCD],[TransCathAorticValveInterventionIND] from [dbo].[CardiacReferralTAVIIntraProcedure];
Thanks,
Jag
Ranjeeta
Pyrite | Level 9
Thankyou !!
How would I add more years to the code below e.g :2018-04-1' and '2019-03-31'
USE WCPRDDB1
GO

SELECT

ip.WaitlistEntryID
,ip.TAVIAccessSiteCD
,ip.TransCathAorticValveInterventionIND
,cwle.RemovalDate
,f.FacilityName
,f.FacilityNumber
FROM
CardiacWaitListEntry CWLE

INNER JOIN [CardiacReferralTAVIIntraProcedure] IP ON
CWLE.waitlistentryID = ip.waitlistentryid

INNER JOIN Site S ON
s.SiteNumber = cwle.AcceptanceSiteNumber

INNER JOIN FacilitySiteRel FSR ON
Fsr.SiteNumber = s.sitenumber

INNER JOIN Facility F On
F.FacilityNumber = fsr.FacilityNumber

WHERE
IP.TransCathAorticValveInterventionIND = 'Y'
AND cwle.RemovalDate between '2017-04-1' and '2018-03-31'
AND cwle.removalreasonCD = 'PS'
and cwle.fundingsourceCD = 'H'
and cwle.authorityissuing = 'CANON'





SASKiwi
PROC Star
AND cwle.RemovalDate between '2017-04-01' and '2019-03-31'

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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