Declare @StartDate/@EndDate in SQL View; cannot save (for use w/ ODBC)

I have searched all over to find out how, in proper syntax, to code a date range-specific query that works just fine in SAP, but cannot be saved in a SQL view (to in turn be linked to an Excel spreadsheet).  An answer that links me to the proper thread could be nice... if it truly explains how to begin and end a functioning basic query with a user supplied date range while working in Excel.
The error I receive when starting my view with "declare" is "the Declare cursor SQL construct or statement is not supported."
Here's the beginning and abbreviated end of code from a query that works just fine without the date clause in SQL view:
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET              @StartDate = [%0]
SET              @EndDate = [%1]
SELECT     .........
FROM        .........
WHERE     (T0.DocDueDate >= @StartDate AND T0.DocDueDate <= @EndDate) AND ......
Thank you in advance!
Russell

Hi Russell.
You don't need to use Declare.
Try this
SELECT .........
FROM .........
WHERE (T0.DocDueDate >= '[[%0]]' AND T0.DocDueDate <= '[[%1]]') AND ......
Antonio Ramos
Edited by: Antonio Ramos on Feb 17, 2010 2:38 PM

Similar Messages

  • PSE 8 Mac cannot save for web

    I am unable to save a file for the web. I get the following error message.
    COULD NOT COMPLETE THE EXPORT COMMAND BECAUSE OF A PROGRAM ERROR.
    I am on an iMac running Snow Leopard.
    TIA
    kentsb909

    First go to your username>library>preferences and delete:
    com.adobe.PhotoshopElements.plist
    Adobe Photoshop Elements 8 paths
    Adobe Photoshop Elements 8 settings
    and any Adobe Save for Web preferences you can find, then repair permissions and try again. If it still fails, uninstall (use the uninstaller in the PSE 8 folder in applications) and reinstall.

  • Cannot save for web - unknown system error Photoshop CS5

    I've attached the error I recieve here: http://img838.imageshack.us/img838/5624/screenshot20101027at122.png
    What happens is I create any new document, and when I try to save for web it comes up with "unknown system error has occurred'. Prior to this it worked perfectly (pretty much just 2 hours ago)! Also, my Photoshop CS4 stil works properly. I've been searching for solutions but nothing has come up in regards to this particular error.
    I'm running the CS5 Extended edition suite, on 10.6.4 if this helps.

    Hi,
    Could you please send your system info to me([email protected]) to have a look?
    Thanks,
    Ping

  • I cannot save for web

    i have the trial version of cs5 how do i enable save for web?
    all the other versions of photoshop it works easy for me
    but what do i need to do to enable save for web?

    under adjustments > HDR toning... ?
    then default
    it doesnt work
    i'm just trying to edit some text my artist did
    he did it in cs5 with hdr
    because hdr is involved i cant use my regular photoshop
    thats why i'm using the trial version of cs5

  • SQL-Editor / Cannot Save PL/SQL Changes to Server

    Hello,
    I just gave the Oracle DTP Plugin an short try. Cool feature! It would help a lot to have good SQL / PL/SQL development functionality within Eclipse.
    During my first test I could not save changes of PL/SQL Code in the SQL-Editor to the server.
    Click on the "Floppy-Disk"-Icon gives me an Error-Popup "Save Failed:null"
    Right-Click "Save to Server" is doing nothing.
    My Tool-Stack is:
    Eclipse SDK Version: 3.2.2 / Build id: M20070212-1330
    DTP 1.5.0.200707041
    Oracle DTP Plugin 1.0.0.464
    Bye and thanks for starting the Oracle DTP Plugin Project!
    Frank

    HI,
    I haved the same problem with version 1.0.0.464 (jul2007) !
    When the next version is released ?
    Thanks
    Stacktrace :
    java.lang.NullPointerException
         at org.eclipse.datatools.sqltools.data.internal.ui.editor.EditTableDataAction.selectionChanged(EditTableDataAction.java:63)
         at org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.popup.providers.AbstractSubMenuActionProvider.fillContextMenu(AbstractSubMenuActionProvider.java:24)
         at org.eclipse.ui.navigator.NavigatorActionService.addCommonActionProviderMenu(NavigatorActionService.java:205)
         at org.eclipse.ui.navigator.NavigatorActionService.fillContextMenu(NavigatorActionService.java:172)
         at org.eclipse.ui.internal.navigator.CommonNavigatorManager.fillContextMenu(CommonNavigatorManager.java:255)
         at org.eclipse.ui.internal.navigator.CommonNavigatorManager$4.menuAboutToShow(CommonNavigatorManager.java:270)

  • [tutorial: inserts_updates_deletes] sql ex. cannot save changes

    I working on the tutorial mentioned in the title. When I try to submit the changes on a new row I got the following error in the message box:
    Error:java.sql.SQLException: Expected to find "end of SQL command" instead found ";" at position 62.The exception is throw by this code, wich is completely copied by the tutorial:
    public String save_action() {
            try {
                // Get the next key, using result of query on MaxTrip data provider
                CachedRowSetDataProvider maxTrip = getSessionBean1().getMaxTripDataProvider1();
                maxTrip.refresh();
                maxTrip.cursorFirst();
                int newTripId = ((Long) maxTrip.getValue("MAXTRIPID")).intValue();
                // Navigate through rows with data provider
                if (tripDataProvider.getRowCount() > 0) {
                    tripDataProvider.cursorFirst();
                    do {
                        if (tripDataProvider.getValue("TRIP.TRIPID").equals(new Integer(0))) {
                            tripDataProvider.setValue("TRIP.TRIPID", new Integer(newTripId));
                            newTripId++;
                    } while (tripDataProvider.cursorNext());
                tripDataProvider.commitChanges();
            } catch (Exception ex) {
                log("Error Description", ex);
                error("Error :"+ex.getMessage());
            return null;
        }Any suggestions?
    Thanks in advance.

    Hi sandro,
    Check SQL you entered for maxTrip and tripDataProvider rowsets. Most probably, it's ended by ';'. It shouldn't.
    Thanks, Misha
    (Creator team)

  • Encrypting communication between an app that uses an ODBC/DSN (with ADODB) and SQL Server 2008 R2

    I've been doing a lot of reading the last couple of days on how we can encrypt db communication between our product app and a customer's SQL Server db, but cannot make it work as expected. The app uses a ODBC/DSN to connect to the SQL Server db. I use this
    ODBC app to setup the DSN (on a Windows 7 PC):
    C:\Windows\SysWOW64\odbcad32.exe
    The  DSNconnection uses the SQL Server driver 6.01.7601.17514 and has these properties:
    - WinNT authentication.
    - Client Config button: TCP/IP to <server-name>\<instance.-name>
    - Change to default db: <name-of-app-db>
    - Everything else is default setting.
    SQL Server is on the same Windowns 7 PC and has a self-signed cert installed (used IIS to generate it) and has the Force Enryption set to "yes".
    I have a test C# program that uses the ADODB 2.7.0.0 COM-wrapper, made by Visual Studio after adding a reference to the ADO 2.7 library version 6.1.7601.17857. The program creates an ADODB.Connection object that has a simple connection string: "DSN=<san-name>;UID=<user>;PWD=<password>". The
    program then creates an ADODB.Recordset object and reads and displays a field from a table.
    Works fine.
    If I go into SQL Server and set Force Encryption to "no," clear the cert, restart the SQL service, and then re-run the program, it works fine.
    Here's the kick. If I go into the DSN and select "Use strong encryption for data" the Test button on the DSN works—why does it work? The SQL Server is no longer encrypting the connection so an error should occur. If I run the test program, it works
    as well—why? I can look at the connection properties in the test program and see that ADODB has added the ";Encrypt-yes" stuff to the end of the connection string. Yet that option seems to have no effect.
    If I set the SQL instance back to Force Encryption:yes, enable the cert, restart the SQL service, and clear the DSN's "Use strong encryption for data" option, I can still connect to the db with the
    test program—why?
    What am I doing wrong? I need to be able to ensure that the communication between our app product and the SQL instance is encrypted, and that we get an error if the SQL instance does not support encrypted communications. We really don't want the customer
    to have to enable Force Encryption because they have other db's on their SQL Server that do not use encrypted communication, but they want to know that our product's communication channel with the db is encrypted.
    No, I can't change the app product's code at this point in time. I'm stuck with working with what a DSN called from ADODB has to offer.
    Also, how can I be sure that communications are encrypted? I mean, I've tried things like "SELECT * FROM sys.dm_exec_connections" but that doesn't help because I have no idea how to tie the list of sessions shown back to my test program, although
    I guess it's a good thing that some of the sessions listed show encrypt_option as TRUE.
    -glenn-

    Ah yes, very good point. It's easy to miss because you have to delete then recreate the DSN in order to change drivers. So I switched the DSN over to the SQL Native 11 driver.
    Now when I try to connect to the SQL instance as <computer-name>\<instance-name>, and without a cert on the server, I get "the target principal name is incorrect". Perfect; now we're getting somewhere!
    Change my DSN to use <fqdn>\<instance-name> and it works. This tells me that SQL Server has auto-generated a cert and named it <fqdn>. I would have expected the "cert fail" error, not a cert
    name mismatch, because I'm not using Trust Server Cert.
    So I load up my self-signed cert, and that works too.
    I am still confused as to why I'm not seeing the "cert fail" error when I have no cert loaded on the SQL Server. I am not using Force Encryption on the server at all, so wouldn't expect SQL Server to auto-create a cert when an Encrypt=yes request comes in,
    but apparently it does?
    I also ran into a problem with this:
    select c.session_id, c.encrypt_option, s.client_interface_name
    from sys.dm_exec_connections c
    join sys.sysprocesses s
      on c.session_id = s.session_id
    where s.dbid = db_id('MyDatabase')
    There is no s.client_interface_name, probably should be s.hostname. There's also no s.session_id. I thought maybe this should be s.sid, but then no rows ever come back. The c.session_id looks like 51 and 52, but the s.sid looks like a very long binary number,
    so these two fields cannot be joined. I don't know how to convert the sid's properly so that the join would work. Ah wait, I just found the s.spid column; the join works when that column is used (I assume that's correct anyhow).
    If I add a Thread.Sleep(30 seconds) to my C# program just before the connection is closed, this query shows me the session for the correct hostname has encrypt_option=TRUE.
    And I have to keep my fingers crossed that all the app I/O will still work properly after
    changing the driver. Probably a safe bet though.
    Think I'm ready to throw in the towel on getting the "cert fail/no SSL" error to appear.
    It does look like I am able to sufficiently show that the connection is encrypted when Encrypt=yes is used with the newer driver.
    Thank for all the help!
    -glenn-

  • CS5 Save for Web and Devices problem

    I recently installed CS5 and now I cannot save for Web and Devices.  A pop up error window appears saying "A write permissions error has occurred".  Any suggestions to make it possible to save for Web and Devices would be appreciated.
    Also, when I exit Photoshop CS5, yet another pop up window appears and reads, "Could not save Preferences because the file is locked or you do not have the necessary access privileges.  Use the 'Get Info' command in the Finder to unlock the file or change permissions on the file or enclosing folders'.  Again, any suggestions as to what this message is about and how to make PS close as it did with CS4 would be appreciated!
    Thanks,
    E

    Try this first:
    Applications > Utilities > Disk Utility > Macintosh HD > Repair Disk Permissions
    Also make sure your not saving to a removable hard drive that is NTFS. If you can drag files into the drive its the right type of drive to use and there shouldn't be a problem.
    Apart from that all i can say is to restart your Mac and make sure all the adobe updaters are up to date
    Hope that helps
    James

  • Why cant I rotate and save a picture from iphone 4s in windows photo viewer windows 7? the error is cannot save because there is a problem with the photo properties. I can rotate and save screenshots

    why cant i rotate and save a picture from iphone 4s in windows photo viewer windows 7? the error is cannot save because there is a problem with the photo properties. I can rotate and save screenshots

    Windows do not repect the digital EXIF specification. Use a free viewer http://www.irfanview.net/ for Windows.

  • Calendar on iOS 7.1: Cannot Save Event - That event does not belong to that event store.

    Hi All,
    I have an iPhone 5 running iOS 7.1.
    Yesterday, while updating a birthday in the iPhone iOS calendar app (default calendar = GMail), I noticed that the new 'List View' in the iOS 7.1 calendar (and only that view) showed an event called 'New Event' - which has a start date of 2014 and an end date of 2001. If I go into that event, it will show me no title and no location - only, as mentioned, funny start and end times. The 'Delete Event' button is completely missing. This 'New Event' does not come up in any other view.
    Trying to input a ficticious title with a valid start and end time into that event slot leads to a message from the calendar app saying: "Cannot Save Event - That event does not belong to that event store." I have deleted all calendars and re-add them again via settings, with / without soft and hard reset and tried every possible combination. Yet, the event will not disappear.
    The funny thing is that this 'New Event' will still showed up, even when my GMail, work and iCloud calendars were disabled. I have, however, subscribed to a GMail calendar for Australian holidays, and there is a built-in 'Birthday' calendar that pulls the dates from the contacts (I do not use that contact field, though).
    Does anyone have a similar issue? Any suggestions how to fix it?
    Thanks in advance!
    Edit: This 'New Event' does not seem to sync to any calendar other than on the iPhone - not to Gmail, not to work, not to iCloud.

    Had same problem. Although the phone looks off   it actually isnt.  If you actually turn it off and then on again this problem will disappear. I think its a memory overload issue that is solved by clearing the memory by turning it off.
    Worked for me

  • Coalesce in a SQL View?

    I have a table as shown below:
    I need to write a sql view that will show 1 row for the ReqNbr and then a column for the related service calls.  For example the result set should look something like this:
    ReqNbr, Call_Numbers
    10010, 0000013147;0000013097;0000013149;
    10592, 0000012994;0000012999;
    and so on.  I need a view that can do this as a function or stored procedure can't be used in the reporting tool that I'm dealing with.  In addition I would like the Service Call to be sorted ASC in the column when returned.
    Any ideas?

    You need to use a stuff operator for this purpose... see this
    http://sqlsaga.com/sql-server/how-to-concatenate-rows-into-one-row-using-stuff/
    DECLARE @Input TABLE
    ReqNbr INT,
    ServiceCall VARCHAR(20)
    INSERT INTO @Input VALUES(1, '0001'), (1, '0002'), (1, '0003'),(2,'0004'), (2,'0005'), (1, '0006')
    SELECT DISTINCT ReqNbr, STUFF((SELECT ';'+ServiceCall FROM @Input b WHERE a.ReqNbr = b.ReqNbr FOR XML PATH('')), 1, 1, '') AS ServiceCall
    FROM @Input a
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Cannot save attached files in Mail

    My problem has to do with using the Mail program on a MacBook Pro running Mavericks. Lately when I receive an email with a file attachment (image, Word doc, PPT file, whatever) I cannot save the attached file. 
    I point to the attachment "download" dialog box, and choose either the "save all" option or the specific attachment filename shown, then navigate to the desired folder and hit "save".  But no file is created. 
    The attachments are there - if I look at the same email using the gmail web-based mail utility I can easily download it. It's a problem with the Apple Mail client.
    Any suggestions?  Thank you.
    Jerry

    Zips and other archived/compressed files won't work as expected on an iPad since you can't just preview/view the contents directly from the attachment currently like you can with quicktime-compatible or other common media formats. Basically you would need to be able to save the zip file to the finder and extract it, and view the contents from there. But since the iPad doesn't have anything like a user-accessible Finder, it's tricky to implement.
    There may be third-party apps that deal with this eventually (or maybe even something from the upcoming 4.0 software, who knows), but it would probably be easier to just have people send you attachments that aren't zipped up for now.

  • I created a form using acrobat XI pro.  SOME users of the form cannot save the form.  what can i do from my side to 'correct' the issue?

    i created a form using acrobat XI pro.  SOME users of the form cannot save the form.  what can i do from my side to 'correct' the issue?

    Do you know what PDF viewer those users were using? Do you have any more details about what happens when they attempt to save?

  • My bookmarks are disappearing/reappearing randomly and I cannot save new ones

    Since this morning 8/17 I have had an odd problem with my bookmarks. Initially both my Blogs and News and Views sub-folders came up empty while nothing else was affected and the bookmarks in them were not to be found elsewhere. Later, after a reboot, I was able to get back some but by no means all of the ones in those folders. I also cannot save any new bookmarks (which would have solved the problem since I can look up the websites I'm currently missing). Also the history/show all button brings up the bookmark menu but it is not saving anything as 'show all today' comes up empty.
    The only thing I can think of was that last night, while trying to solve an unrelated problem, I went to tools>options>privacy and cleared my history from there. Unfortunately, I was not having this problem right after that although I rebooted my computer afterwards.
    I just updated firefox a few minutes ago so it isn't an upgrade issue, I think.
    What the heck is going on?

    It sounds like the file that stores bookmarks and History may be damaged. See [http://kb.mozillazine.org/Locked_or_damaged_places.sqlite Locked or damaged places.sqlite - MozillaZine Knowledge Base]

  • Cannot save formsweb.cfg through OEM

    Hi All,
    I am using Enterprise Manager with Oracle Application Server (Forms and Reports services), and cannot save changes to the formsweb.cfg file through OEM.
    I can make changes to the file formsweb.cfg manually (with notepad), and the server itself sees these changes, but Enterprise Manager still shows the original settings.
    In our application always we need to do change the of .JAR file simenteneously and it will be deployed in Particular user instance.
    I initially thought this was a cache problem, and re-booted the host. After the rebooting also i cannot see the manual changes in OEM , but it still refuses to make changes itself.
    Does anybody have any ideas??
    Thanks in Advance!
    Santosh

    This is the forum for the SQL Developer tool. You should ask your question in an OEM or Forms forum

Maybe you are looking for

  • Can i use downloaded app in more than 1 device?

    I have 2 Ipads, I have downloaded apps on itunes and I need to make sure if Im allow  to use them on multiple devices or do I have to buy them in this case 2 times?

  • LaserJet P1505n printing slow just for user-level accounts in Win7

    I have several workstations running Win7 Pro 64-bit that have been installed as replacements for XP machines.  All of them print to one of several P1505n printers, and are using the latest drivers from HP.  Under XP there were no problems printing to

  • Photoshop Elements 6

    Photoshop Elements 6.0 appears to be installed on my F drive, but when I go to uninstall it, it isn't in the add/remove programs. If I go to install it again on F, it tells me another version is installed and to remove it. I can install it on C drive

  • Require Vendor Payment List with Payment Terms

    hi how to get Require Vendor Payment List with Payment Terms

  • Laptop broke down after installing kernel 3.0

    My laptop died little after installing kernel 3.0 (the "linux" package). Details: - Laptop model: ASUS K50AB-SX029L, it was exactly 2 years minus 10 days old (based on the purchase date); specifictions here. - using cpufreq frequency scaling (ondeman