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'

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 741 views
  • 1 like
  • 3 in conversation