community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Error: Input Data (8):

Highlighted
Meteoroid

The SQL query below runs fine in SQL but when I put this in Alteryx I get the following error;

 

Error: Input Data (8): Error SQLExtendedFetch: [Microsoft][ODBC Driver 13 for SQL Server]Invalid cursor state

 

 

 

use [edw]

Select

EZ.CourseID as 'Course ID',
EZ.CourseName as 'Course Name',
EZ.RegionName as 'State',
EZ.AccountLevel as 'Account Level',
ez.TeeTimeYear,
sum (EZ.Golfers) as 'Rounds Sold',
sum (EZ.FeeAmount) as 'Revenue',
round (avg(cast(ez.GolfIndex as decimal)),2) as 'Golf Index',
sum (EZ.couponsavings) as 'Coupon',
'EZLinks' as 'Source'

From [dbo].[uvw_PBI_DealTimesDetail_WithFB] as ez

Where EZ.TeeTimeDate between '3/1/2018' and '3/14/2018' and EZ.RegionName in ('Georgia','California','Colorado')
group by EZ.courseid, ez.CourseName, ez.RegionName, ez.AccountLevel, ez.TeeTimeYear

Union

Select


G18.CourseID as 'Course ID',
g18.CourseName as 'Course Name',
g18.RegionName as 'State',
g18.AccountLevel as 'Account Level',
g18.TeeTimeYear,
sum (g18.Golfers) as 'Rounds Sold',
sum (g18.FeeAmount) as 'Revenue',
round (avg(cast(g18.GolfIndex as decimal)),2) as 'Golf Index',
sum (g18.couponsavings) as 'Coupon',
'g18' as 'Source'

From [summary].[uvw_Golf18BarterTimesDetail] as g18

Where g18.TeeTimeDate between '3/1/2019' and '3/14/2019' and g18.RegionName in ('Georgia','California','Colorado')
group by g18.courseid, g18.CourseName, g18.RegionName, g18.AccountLevel, g18.TeeTimeYear

union

 

Select


GS.CourseID as 'Course ID',
GS.CourseName as 'Course Name',
GS.RegionName as 'State',
GS.AccountLevel as 'Account Level',
GS.TeeTimeYear,
sum (GS.Golfers) as 'Rounds Sold',
sum (GS.FeeAmount) as 'Revenue',
round (avg(cast(GS.GolfIndex as decimal)),2) as 'Golf Index',
sum (GS.couponsavings) as 'Coupon',
'GS' as 'Source'

From [summary].[uvw_GolfSwitchBarterTimesDetail] as GS

Where GS.TeeTimeDate between '3/1/2019' and '3/14/2019' and GS.RegionName in ('Georgia','California','Colorado')
group by GS.courseid, GS.CourseName, GS.RegionName, GS.AccountLevel, GS.TeeTimeYear

This can sometimes be caused by rich text format which alteryx can't account for when copying a query from other SQL editors.

 

Copy and paste your query into notepad (must be notepad), save the notepad file and close it. Re-open the file and copy the text back into the alteryx SQL editor window, this should have removed the rich text format and hopefully solve your issue.

 

If this does solve it please mark it as correct and answered, if not then let me know!

 

J

 

Labels