POWER PIVOT SQL SERVER statement error

jak82

Board Regular
Joined
Apr 28, 2016
Messages
146
Hi,

I am using Power Pivot to read in data from our server I am wanting to say if that if a field is blank to return prepaid, this works in normalk other query in excel but doesn't seem to work in the sql sever this is the code I am using

Code:
SELECT
  adtrans.adnumbr
  ,adtrans.adnumpr
  ,adtrans.jimname
  ,adtrans.adcatgy
  ,adtrans.amtgros
  ,adtrans.adoper
  , CASE WHEN adtrans.fred <> '' THEN adtrans.fred ELSE 'PREPAID' END
  ,insertbk.dateins
FROM
  adtrans
, insertbk
, custacct
WHERE
adtrans.adnumbr = insertbk.adnumbr
AND custacct.custacc = adtrans.fred

The error I am having returned is the 'The SQL statement is not valid. A column name cannot be blank.'

It is not the column but the field I am trying to reference.

Thanks
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top