Unexpected: "may not have a type qualifier" error

Hi,
When I uses a 3rd party auto pointer utility, an unexpected "may not have a type qualifier" error raised. I hacked into the code and able to reproduce the problem with the following program.
Any one have workaround or solution for it?
Thank you very much.
Compiler version:
$ CC -V
CC: Sun C++ 5.7 Patch 117830-09 2006/11/01
OS version:
$ uname -a
SunOS niss165 5.10 Generic_118833-20 sun4us sparc FJSV,GPUZC-M
Compilation output:
$ CC main3.cpp
"main3.cpp", line 11: Error: func1 may not have a type qualifier.
"main3.cpp", line 45:     Where: While instantiating "AutoPtr<BarFoo<Bar, Foo<T>>>::~AutoPtr()".
"main3.cpp", line 45:     Where: Instantiated from non-template code.
"main3.cpp", line 11: Error: Cannot use AutoPtrRep<BarFoo<Bar, Foo<T>>>* to initialize int.
"main3.cpp", line 45:     Where: While instantiating "AutoPtr<BarFoo<Bar, Foo<T>>>::~AutoPtr()".
"main3.cpp", line 45:     Where: Instantiated from non-template code.
2 Error(s) detected.Test Program:
template <class A>
class AutoPtr
public:
    AutoPtr(void)
    ~AutoPtr(void)
        AutoPtrRep<A>::func1(rep); // compilation error
private:
    AutoPtrRep<A>* rep;
template <class C>
class AutoPtrRep
public:
    static void func1(AutoPtrRep<C>*& rep)
        // do something
class Bar
template <class T>
class Foo
template <class E, template <class T> class F>
class BarFoo
int main()
    // lead to compilation error
    AutoPtr< BarFoo<Bar, Foo> > ptr;
    // no error
    //AutoPtr< Bar > ptr;
    // no error
    //AutoPtr< Foo<int> > ptr;
}Message was edited by:
germancheung

This bug is fixed in the Sun C++ 5.8. If you have a
service contract you can escalate this problem for
Sun C++ 5.7. It looks like there is no workaround for
this bug.BTW, do you have the bug ID for this specific error? coz I need to show evidence for it to give reason for an upgrade.
Thanks.

Similar Messages

  • Errors in the high-level relational engine. The data source view does not contain a definition for the table or view. The Source property may not have been set.

    Hi All,
    I have a cube in which i'm using the TIME DIM that i created in the warehouse. But now i wanted a new measure in the cube which is Average over time and when i wanted to created the new measure i got a message that no time dim was defined, so i created a
    new time dimension in the SSAS using wizard. But when i tried to process the new time dimension i'm getting the follwoing error message
    "Errors in the high-level relational engine. The data source view does not contain a definition for "SSASTIMEDIM" the table or view. The Source property may not have been set."
    Can anyone please tell me why i cannot create a new measure average over the time using my time dimension? Also what am i doing wrong with the SSASTIMEDIM, that i'm getting the error.
    Thanks

    Hi PMunshi,
    According to your description, you get the above error when processing the time dimension. Right?
    In this scenario, since you have updated the DSV, it should have no problem on the table existence. One possibility is that table has been specified for tracking in the notifications for proactive caching, but isn't available any more for some
    reason. Please change the setting in Proactive Caching into "MOLAP".
    Reference:
    How To Implement Proactive Caching in SQL Server Analysis Services SSAS
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • When I try to open iTunes, I get this error message: Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item. I get a different error message if I try to uninstall it.

    When I try to open iTunes, I get this error message: "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item." I've been able to uninstall all Apple products except iTunes as I get this error message: "The Installer has insufficent privileges to modify this file: C:\Program Files\i Tunes\Acknowledgments.rtf." I've had the iTunes on my laptop for a year and a half with no problems until now.

    Any suggestions please?

  • TS2167 i'm getting an error message.. can't create the file "header.jpg." The disk may be damaged or full, or you may not have suuficient access priveleges.

    I need to publish to a local folder on my desk top and I am getting this error message.
    can’t create the file “header.jpg.” The disk may be damaged or full, or you may not have suuficient access priveleges.
    Please help... I need to copy to a disk... it was working fine until I attached a big project, I tried to delete the project, but still not workng.

    Try the following:
    1 - delete the iWeb preference file, com.apple.iWeb.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iWeb's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iWeb folder (Snow Leopard and Earlier).
    3 - launch iWeb and try again.
    NOTE:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • After auto update recently, norton internet security won't work. error message:windows cannot access specified path...you may not have appropriate permissions to access item

    Firefox did an auto update and since then I cannot open/run Norton Internet Security. It won't even let me update it or re-install it. I get an error message stating Windows cannot find the specified path. You may not have appropriate permissions to access this.

    Hi
    Some required information are needed for us to help you.
    Hi NabeelOmer,
    We wonder if you have taken any action such as system restore after this issue occurred.
    You might also try this command to restore your access control list.
    Run this command to navigate to the drive letter, example is D
    D:
    To reset all permissions, run this command
    icacls * /reset /t /c /q
    Visual Studio is a very invasive program and which provides the ability to enumerate projects and solutions for system, user should never try uninstalling it manually without any guidance.
    Visual Studio made changes for your whole system, if the file has been moved or deleted this error would occur.
    Since you mentioned that you get this error almost everywhere even in control panel. We suggest you repair/reinstall your Visual Studio first and check if it could be fixed.
    How to: Repair Visual Studio
    https://msdn.microsoft.com/en-us/library/aa983433%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396
    Regards
    D. Wu

  • I receive the following error message when trying to publish site changes to iweb: "Can't create the file "shapeimage_2_link_0.png." The disk may be damaged or full, or you may not have sufficient access privileges." Can anyone assist?

    I receive the following error message when trying to publish site changes to iweb:
    "Can’t create the file “shapeimage_2_link_0.png.” The disk may be damaged or full, or you may not have sufficient access privileges."
    Can anyone assist?

    Try the troubleshooting steps under "Fix iWeb" here...
    http://www.iwebformusicians.com/iWeb/iWeb-Tips.html
    ... and then republish.

  • I keep getting this publish error on my IwebCan't create the file "Typesetter Header3.jpg." The disk may be damaged or full, or you may not have sufficient access privileges.

    I keep getting this publish error on my IwebCan’t create the file “Typesetter Header3.jpg.” The disk may be damaged or full, or you may not have sufficient access privileges.

    I keep getting this publish error on my IwebCan’t create the file “Typesetter Header3.jpg.” The disk may be damaged or full, or you may not have sufficient access privileges.

  • I'm getting a Publish Error reading; Can't create the file "header.jpg." The disk may be damaged or full, or you may not have sufficient access privileges.

    I'm getting a publishing error reading; Can't create the file "header.jpg." The disk may be damaged or full, or you may not have sufficient access privileges.
    Does anyone know how to proceed?
    Thanks!

    Try the troubleshooting steps under "FIx iWeb" here...
    http://www.iwebformusicians.com/iWeb/iWeb-Tips.html
    Some times all it takes is deleting the .plist to fix this but do the restart and permissions repair if you haven't done this proceedure for a while.

  • I uninstalled Firefox and not it will not install for me. I get a error that says, The item referred to by this shortcut cannot be accessed. You may not have the appropriate permissions. What can I do?

    I uninstalled Firefox and not it will not install for me. I get a error that says, The item referred to by this shortcut cannot be accessed. You may not have the appropriate permissions. What can I do?

    Here is a pic.

  • Error optimizing formula for [mbrName]: argument [] may not have size [] in function []

    Hi all,
    Please help me
    I wrote the following script:
    182        "Commercial income tax"(
    183             IF ( "Payment of principal - Short-term" <> #MISSING)
    184                   "Commercial income tax" = 1;)
    It throws following error:
              Error:Error optimizing formula for [Commercial income tax] (line 182): argument [2] may not have size [-4] in function [@NE] Rule PandL.
    What the meaning of these word?
    argument [2]
    size [-4]
    Is there another way of accomplishing the above?

    Yeah, Anthony,
    I ve just written Calculation Scripts 6 month ago.
    Your question:  "Commercial income tax" and the "Payment of principal - Short-term" members are Accounts ?
    My Answer: Yes, they are.
    My full IF statement:
    182        "Commercial income tax"(
    183             IF ( "Payment of principal - Short-term" <> #MISSING)
    184                   "Commercial income tax" = 1;
    185             ELSEIF ( "Payment of principal - Short-term" == #MISSING)
    186                   "Commercial income tax" = #MISSING;
    187            ENDIF;)
    Warning Error:
              Error:Error optimizing formula for [Commercial income tax] (line 182): argument [2] may not have size [-4] in function [@NE] Rule PandL
    It is not Error if I write following Script:
    182        "Commercial income tax"(
    183             IF ( "Payment of principal - Short-term" <> 0 or "Payment of principal - Short-term" == 0)
    184                   "Commercial income tax" = 1;
    185             ELSEIF ( "Payment of principal - Short-term" <> 0 and "Payment of principal - Short-term" != 0)
    186                   "Commercial income tax" = #MISSING;
    187            ENDIF;)

  • Error in accessing I tunes-"Windows cannot access the specified device,path, or file. You may not have the appropriate permission to access the item"?

    Question- Cannot access to Itunes after downloading photos. Message was "Windows cannot access to the specified device, path or file. You may not have the appropriate permissions to access the item". Plse advise

    Do you get this message when you're trying to sync apps?

  • The item referred to by this shortcut cannot be accessed. You may not have the appropriate permissions

    Hi
    I originally posted this in the Windows 7 Networking forum and they advised to post it here.
    We use Windows 7 SP1 clients with Roaming Profile and Folder Redirection and they are connected to a Windows 2008 SP2 server.  We are getting issues when someone tries to open files on their redirected Desktop and they get the message "'The item
    referred to by this shortcut cannot be accessed. You may not have the appropriate permissions" if you click browse it then defaults to a different users profile.  If you click through the errors the file eventually loads.  If you open Word from
    the Start menu and then browse to the file it opens fine.  We have found that deleteting the Normal.DOTM file sometimes fixes the error, but only seems effective 50% of the time.  This doesn't happen for all users, and seems to occur in small
    groups and not all the time.  We have also had the same message come up with someone trying to open Word files an online learning resource we have created.
    There are a couple of events showing for about the time the error occured they are:
    Type Error Source Application Error Category Name 100 Event 1000
    Faulting application name: WINWORD.EXE, version: 14.0.4762.1000, time stamp: 0x4bae25b7
    Faulting module name: wwlib.dll, version: 14.0.4762.1000, time stamp: 0x4bae2623
    Exception code: 0xc0000005
    Fault offset: 0x00034b81
    Faulting process id: 0x1734
    Faulting application start time: 0x01d0234ef75c42aa
    Faulting application path: C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE
    Faulting module path: C:\Program Files (x86)\Microsoft Office\Office14\wwlib.dll
    Report Id: 6f74438b-8f42-11e4-9e45-00c2c6506cb5
    Type information Source Office Software Protection Platform Service Category Name 0 Event 1003The Software Protection service has completed licensing status check.
    Application Id=59a52881-a989-479d-af46-f275c6370663
    Licensing Status=
    1: 1f76e346-e0be-49bc-9954-70ec53a4fcfe, 1, 1 [(0 [0x00000000, 1, 0], [(?)(?)( 1 0x00000000 30 0 msft:rm/algorithm/hwid/4.0 0x00000000 0)(?)(?)(?)])(1 )(2 )]
    2: 9da2a678-fb6b-4e67-ab84-60dd6a9c819a, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1 )(2 )]
    3: dd457678-5c3e-48e4-bc67-a89b7a3e3b44, 1, 0 [(0 [0xC004F014, 0, 0], [(?)(?)(?)(?)(?)(?)])(1 )(2 )]
    The software protection message we get in clusters of about 6 or more multiple times through the day

    Hi
    An update.  We have approx 400 people with roaming profile/folder redirection on Windows 7/2008 and this only seems to have occurred to about 15 people, and then seems to clear up for a period and then happens again.  We also have a similar number
    of people with roaming profile/folder redirection on Windows 7/2003 system and we haven't had a report of this issue happening on this setup.
    So far we haven't been able to replicate the issue using a test account, so are struggling to find out what is causing it and why it is so random.
    Regrds
    Dave

  • The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.

    Hi,
    I'm not able to access the term store. I get an below mentioned error.
    "The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator. "
    Since this is happening on my local machine (Dev environment). I have full control on the term store and the all the site collections.
    Hence, this is not a permission issue.
    I have checked, the Metadata service is active on the machine. All the application pools in IIS is running.
    After reading one of the recommendation on internet, I created a new Managed Metadata Service.
    After which I was able access both (old and new) MMS from Central Admin only (highlight the MMS from manage service applications and click Manage ) and not from the site collection (term store management).
    Now again its not working after I did an IISRESET.
    The managed metadata service (Managed Metadata Service Connection) is grayed out.
    ULS Error says:
    Failed to create ManageLink for service proxy 'Managed Metadata Service'. Exception: System.TimeoutException: The request channel timed out attempting to send after 00:00:09.9999999. Increase the timeout value passed to the call to Request or increase the SendTimeout
    value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://mitkar4:32843/7a91ec90b46843e995c144be48d804f0/MetadataWebService.svc' has exceeded the allotted
    timeout of 00:00:09.9990000. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out 
    Please let me know if you need more information.

    Hi Victoria,
    Thanks for your reply
    I tried making all the changes you had recommended and which are mentioned in the link you have provided.
    I tried making all possible combination of changes to the web.config and client.config files but it does not make any difference to the environment.
    One thing is that, my error in ULS logs has changed.
    Error 1: 
    Exception returned from back end service. System.TimeoutException: The request channel timed out attempting to send after 00:00:09.9999999. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted
    to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://mitkar4:32843/b1640facdf8b49b0886fea1bd37b8eb3/MetadataWebService.svc' has exceeded the allotted timeout of 00:00:09.9990000. The time
    allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out 
        at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) 
        at System.Net.HttpWebRequest.GetRequestStream() 
        at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()     --- End of inner exception stack trace --- 
        at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() 
        at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) 
        at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)     --- End of inner exception stack trace ---    Server stack trace:  
        at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
        at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
        at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:  
        at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
        at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
        at Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication.GetServiceSettings(Guid rawPartitionId) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2f.<ReadApplicationSettings>b__2e(IMetadataWebServiceApplication serviceApplication) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2c.<RunOnChannel>b__2b()
    Error 2:
    Error encountered in background cache check System.TimeoutException: The request channel timed out attempting to send after 00:00:09.9999999. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time
    allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://mitkar4:32843/b1640facdf8b49b0886fea1bd37b8eb3/MetadataWebService.svc' has exceeded the allotted timeout of 00:00:09.9990000.
    The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out 
        at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) 
        at System.Net.HttpWebRequest.GetRequestStream() 
        at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()     --- End of inner exception stack trace --- 
        at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() 
        at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) 
        at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)     --- End of inner exception stack trace ---    Server stack trace:  
        at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
        at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
        at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
        at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:  
        at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
        at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
        at Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication.GetServiceSettings(Guid rawPartitionId) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2f.<ReadApplicationSettings>b__2e(IMetadataWebServiceApplication serviceApplication) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2c.<RunOnChannel>b__2b() 
        at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.<>c__DisplayClass2c.<RunOnChannel>b__2a() 
        at Microsoft.Office.Server.Utilities.MonitoredScopeWrapper.RunWithMonitoredScope(Action code) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.RunOnChannel(CodeToRun codeToRun, Double operationTimeoutFactor) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.ReadApplicationSettings(Guid rawPartitionId) 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.get_ServiceApplicationSettings() 
        at Microsoft.SharePoint.Taxonomy.MetadataWebServiceApplicationProxy.TimeToCheckForUpdates() 
        at Microsoft.SharePoint.Taxonomy.Internal.TaxonomyCache.CheckForChanges() 
        at Microsoft.SharePoint.Taxonomy.Internal.TaxonomyCache.<LoopForChanges>b__0().

  • I have Mac OS X, using boot camp i installed windows 7.  installation was successful but when i try to select to boot back to mac os x via boot camp from Windows 7 control panel, its saying "You may not have privileges to change the startup disk..."

    from the boot camp control panel, highlighted "Macintosh HD Mac OS X", click on Restart button or click OK or click Apply buttons gave me "An error occurred while trying to change the startup disk.  You may not have privileges to change the startup disk.  Make sure you have administrative privileges and try again."
    Im logged in to Windows 7 as admin thou but still giving me the above message.
    i rebooted & the option key does not give me option to boot to Mac instead gives me a screen with lock then below is a blank field then a right arrow on the right side, i normally hit the power button from this screen
    please help
    thx

    sorry for digging up an old thread, but what was the problem?

  • "This message may not have been delivered to User Name because there was no response from the server." in IM chat

    Hello All, 
    Sometime users are getting below error message on the IM windows when they having P2P IM Chat. 
    "This message may not have been delivered to User Name because there
    was no response from the server."
    I can see below error on the Lync 2013 Monitoring page. 

    Hi,
    Please make sure all required ports have been allowed. You can verify that all ports are open can accepting connections using telnet.
    Telnet from External Client:
    Test to SIP.domain.com 443/SIP
    Test to WebConf.domain.com 443/PSOM
    Test to AV.domain.com 443/STUN
    Telnet from Lync 2013 Edge:
    Telnet to Pool.domain.com 5061/SIP
    Telnet from Lync 2013 Pool:
    Telnet to LyncEdge.domain.com 5061
    Telnet to LyncEdge.domain.com 443
    Telnet to LyncEdge.domain.com 5062
    Telnet to LyncEdge.domain.com 4443
    Telnet to LyncEdge.domain.com 8057
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

Maybe you are looking for

  • Error in pakcage table or view does not exist but on sql prompt query works

    Hi Can any one help me to understand the error of ORA-00942: table or view does not exist while compiling the package on Oracle 9.2.0.4.0 The below package compiled in system user and trying to query on view v$session_wait however getting below error

  • DVI - Sony TV doesn't work: PAL vs. NTSC ???

    I'm trying to connect my MacBook Pro via a DVI->HDMI cable to a Sony HDTV (KLV-V32A10E). The Displays Preferences detects the second display ("SONY TV"), but the TV remains blank. Interestingly enough, none of the preferred suggested resolutions (i.e

  • Idea. Not sure if its available option

    I did some searching on a few occasions but have not been able to find what im looking for. Maybe I have used the wrong terms in the search IDK. What I would find incredibly useful between my Imac, Iphone and if I bought an ipad is the ability to sea

  • B575 Play HD Video

    Is the B575 able to play HD video such as movies and tv shows from iTunes? Thanks

  • I find it annoying that you can't use aliases in where statements

    I find it annoying that you can't use aliases in where statements for example: SELECT TOP 1 CAST(amount / ( CASE WHEN ISNULL(rate, 0) <> 0 THEN rate ELSE 1 END ) AS NUMERIC(10, 2)) AS num FROM table WHERE num > 1 ORDER BY num Are there any workaround