How to report only quantities less than zero on a calculated field

I do not understand why my text will not work when it comes to reporting only 'Missing POs' less than zero, I assume it is because I am using 'int' on some fields?
Any advice?
SELECT
t0.father as 'Parent Code',
t2.itemname as 'Parent Description',
t2.frgnname as 'Parent Status',
t0.code as 'Child Code',
t1.itemname as 'Child Description',
t1.frgnname as 'Child Status',
t0.comment as 'Master',
cast(t3.onhand as int) as 'Child Uncommitted Stock',
cast(t3.iscommited as int) as 'Child Committed Stock',
(cast(t3.onhand as int) - cast(t3.iscommited as int)) as 'Child Free Stock',
cast(t3.onorder as int) as 'Purchase Orders',
(cast(t3.onhand as int) - cast(t3.iscommited as int)) + cast(t3.onorder as int) as 'Missing POs'
FROM
itt1 t0
inner join oitm t1 on t0.code = t1.itemcode
inner join oitm t2 on t0.father = t2.itemcode
LEFT JOIN OITW T3 ON T3.WHSCODE = T0.Warehouse AND T3.ItemCode = T0.Code
Where T3.WHSCODE Like '[%0]%' and 'Missing POs' < 0
ORDER BY
'Missing POs' asc, t0.father, t0.code
Many thanks,
Robin (I will be awarding points on all my outstanding questions shorlty - management time pressure at mo!)

Try this:
SELECT
t0.father as 'Parent Code',
t2.itemname as 'Parent Description',
t2.frgnname as 'Parent Status',
t0.code as 'Child Code',
t1.itemname as 'Child Description',
t1.frgnname as 'Child Status',
t0.comment as 'Master',
cast(t3.onhand as int) as 'Child Uncommitted Stock',
cast(t3.iscommited as int) as 'Child Committed Stock',
(cast(t3.onhand as int) - cast(t3.iscommited as int)) as 'Child Free Stock',
cast(t3.onorder as int) as 'Purchase Orders',
(cast(t3.onhand as int) - cast(t3.iscommited as int))
  + cast(t3.onorder as int) as 'Missing POs'
FROM
itt1 t0
inner join oitm t1 on t0.code = t1.itemcode
inner join oitm t2 on t0.father = t2.itemcode
LEFT JOIN OITW T3 ON T3.WHSCODE = T0.Warehouse AND T3.ItemCode = T0.Code
Where T3.WHSCODE Like '%0%' and (cast(t3.onhand as int) - cast(t3.iscommited as int))
  + cast(t3.onorder as int) < 0
ORDER BY
(cast(t3.onhand as int) - cast(t3.iscommited as int))
  + cast(t3.onorder as int),t0.father, t0.code

Similar Messages

  • E2136 ySubscriptXOffset is less than zero -11

    Hallo,
    Every (or mostly) italic fonts generated by the FDK give the the
    following error code from the MS Fontvalidator.
    E2136 ySubscriptXOffset is less than zero -11
    Is this a real problem?
    Andreas

    We believe this is a bug inthe Font Validator, and have reported it to Microsoft. There are perfectly good reasons to have automatic subscript to shift stuff to the left with an italic font.
    T

  • Control account balance isn't less than zero

    Dear buddies:
    I wanna control  that account balance isn't less than zero when entering G/L document. I remember there is a warnning message for bank account, but I forgot how to configurate it!
    Please you help me, thanks!
       sherky

    Hello
    Not sure what customizing you refer to but you can do this control trough a validation at complete document level.
    Regards
    Javier

  • Java.sql.SQLException: Invalid precision value. Cannot be less than zero

    Hi,
    In my portlet application have several jsf tables which bind to several oracle tables. I have tested the portlet in pluto and tried to deploy it on liferay. However, I get an exception stating:
    java.sql.SQLException: Invalid precision value. Cann
    ot be less than zero
    What could this exception mean? Has anyone else encountered this?
    Marc
    P.S. The trace is shown below:
    Feb 6, 2007 12:34:56 AM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.RuntimeException: java.sql.SQLException: Invalid precision value. Cann
    ot be less than zero
    at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(Cach
    edRowSetDataProvider.java:343)
    at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(Ca
    chedRowSetDataProvider.java:300)
    at com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(Cache
    dRowSetDataProvider.java:624)
    at com.sun.rave.web.ui.component.TableRowGroup.getRowKeys(TableRowGroup.
    java:806)
    at com.sun.rave.web.ui.component.TableRowGroup.getFilteredRowKeys(TableR
    owGroup.java:429)
    at com.sun.rave.web.ui.component.TableRowGroup.getRowCount(TableRowGroup
    .java:749)
    at com.sun.rave.web.ui.component.Table.getRowCount(Table.java:307)
    at com.sun.rave.web.ui.renderer.TableRenderer.renderTitle(TableRenderer.
    java:400)
    at com.sun.rave.web.ui.renderer.TableRenderer.encodeBegin(TableRenderer.
    java:123)
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav
    a:683)

    I've dug deeper into this problem and am able reproduce the error in the Pluto server. To reproduce this error, I modified my Oracle jdbc driver from the JSC embedded driver (smoracle.jar) to the Oracle native driver (ojdbc14.jar). Now, I am getting the exception in my Sun Application Server:
    What is the difference between ojdbc14.jar and smoracle.jar that could cause this problem? What can I do so that I can fix this problem for ojdbc14.jar?
    Thanks,
    Marc
    P.S.
    The problem is with the clob column (DOR_NOTE_TX). The stack trace is:
    [#|2007-02-06T09:00:53.663-0800|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID=16;|
    Reader executing query ps=0 SELECT DOR_NOTE_DT, DOR_NOTE_TX FROM DOR.DOR_NOTE_DATA WHERE DOR_NOTE_CD='SECURITY' AND TO_CHAR(DOR_Note_Dt, 'mm/dd/yyyy') = '02/05/2007'
    No Params|#]
    [#|2007-02-06T09:00:53.679-0800|WARNING|sun-appserver-pe8.2|javax.enterprise.system.stream.err|_ThreadID=16;|
    java.sql.SQLException: Invalid precision value. Cannot be less than zero
    Message was edited by:
    marcnikko

  • Umbraco CMS - startindex cannot be less than zero error is showing instead of 404 error page

    I am running into an issue with an Umbraco website.
    If I miskey the URL on a top level page, e.g. mysite.com/wrongpage I get an asp error.
    If I miskey it on a subpage, even if the top level page is incorrect too, I get my correct 404 error e.g. mysite.com/wrongpage/wrongpage2
    At this point I'm trying to find out whether it's a bug in Umbraco 4.11.10 or if this error is caused by something obvious. I'm completely stuck and not particularly technical (I'm not a developer).
    If anyone could help explain what this error means, and/or if there's any way to correct or bypass it I would really appreciate the help.
    The full contents of the error are: 
    Server Error in '/' Application.
    StartIndex cannot be less than zero.
    Parameter name: startIndex
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
    Parameter name: startIndex
    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace: 
    [ArgumentOutOfRangeException: StartIndex cannot be less than zero.
    Parameter name: startIndex]
    System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +10698829
    System.String.Substring(Int32 startIndex) +12
    AutoFolders.NotFoundHandler.Execute(String url) +538
    Umbraco.Web.Routing.LookupByNotFoundHandlers.HandlePageNotFound(PublishedContentRequest docRequest) +1148
    Umbraco.Web.Routing.LookupByNotFoundHandlers.TrySetDocument(PublishedContentRequest docRequest) +10
    Umbraco.Web.Routing.PublishedContentRequestBuilder.<LookupDocument1>b__1e(IPublishedContentLookup lookup) +15
    System.Linq.Enumerable.Any(IEnumerable`1 source, Func`2 predicate) +146
    Umbraco.Web.Routing.PublishedContentRequestBuilder.LookupDocument1() +198
    Umbraco.Web.Routing.PublishedContentRequestBuilder.LookupDocument() +195
    Umbraco.Web.Routing.PublishedContentRequest.ProcessRequest(HttpContextBase httpContext, UmbracoContext umbracoContext, Action`1 onSuccess) +139
    Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +339
    Umbraco.Web.UmbracoModule.<Init>b__7(Object sender, EventArgs e) +80
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

    Hi Aaronb9,
    Since the issue regards ASP.NET and website deployment. I suggestion you post the question in the ASP.NET forums at
    http://forums.asp.net/. It is appropriate and more experts will assist you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Err "Only absence less than 1 day are allowed for this absence type

    Hi Experts,
    When I am creating IT2001 record for EL an error is coming, "Only absence less than 1 day are allowed for this absence type". Although Counting rule is defined properly and in check for Condition of absence <1 day & full day both are checked.
    Regards,
    Tomesh

    Hi Nalla,
    The remaining amount for Casual leave is not updated even after we apply the casual leave .
    Suppose there are 20 CL quotas available. If we apply for 2 CLs then remaining should be 18.
    Regards,
    Tomesh

  • Change font colour to red if value less than zero

    Please forgive as I am not sure if this should go to the SQL or Application Thread..
    My questions is regarding SQL in Application Express
    I want to display my field (ADJ (INCL GST) in a red colour if its value is less than zero
    here is SQL code
    select "TW_BILL_ADJ_DATA"."CUSTOMER" as "CUSTOMER",
    "TW_BILL_ADJ_DATA"."ORIGINATER" as "ORIGINATOR",
    CASE WHEN (CREDITDEBIT) = 'Credit' THEN (0 - ADJUSTMENT_INCL_GST) ELSE ADJUSTMENT_INCL_GST END "ADJ (INCL GST)"
    from TW_BILL_ADJ_DATA

    Thankyou for the example above, after much searching I have also found another way to perform the same task
    select     "BILL_DATA"."BILLING_CODE",
    CASE WHEN (CREDITDEBIT) = 'Credit' then
              '<span style="color:Red;">'
              || TO_CHAR (0 - "ADJUSTMENT_INCL_GST", 'FML999G999G999G999G990D00')|| '</span>'
                             else
              '<span style="color:Green;">'
              || TO_CHAR ( "ADJUSTMENT_INCL_GST", 'FML999G999G999G999G990D00')|| '</span>'
                             end "Adj (incl GST)"
    from TW_TABLE
    -----------------------------------------------------------------------------------

  • How to make stills duration less than 00:00:00:01 ?

    Hi,
    This may seem an odd request, but I have a sequence of several stills of a propeller blade on a model, sort of time lapse, move and photo etc, which when played together rotates the prop. They are currently set to 00:00:00:01 and play loop sees a very slow rotation. I thus need to make them even less than that duration. Is that possible and how is it done ? They currently form the project. R/click duration and altering 01 to 001 doesnt work, the last two numbers being frame number and 25fps is the project value.
    Perhaps I need to make the project more than 25fps, so that 00:00:00:01 which means 1 frame I presume, will be seen as far less of a second than 1/25th ? How do I set project to a higher fps if this is the solution ?   Then would I save out or export the finished film as a 25fps clip to use elsewhere ?
    I also found it silly that I had to right click on each stills clip in timelie and choose duration. I tried selecting all of them and r/click duration but duration was greyed out. If I had a lot there, surely there must be a way of making all their durations the same amount at once ?
    I am unable to zoom the timeline to drag their size less.
    Envirographics

    Hi,
    Thanks for the sugestions.
    I have not yet transferred a Sequence, I have created a second sequence and dragged it out as a floating window, then dragged a selection box across my stills and dragged them over to it, but no doubt this isnt the way to make them all a combined duration of say 1 frame. They still have separate properties. How is it done such that I can give them as you say one duration for the entire lot.
    AE no doubt is After Effects. another purchase. Working on it !
    Envirographics.

  • Reporting - using the less than function or the filter.

    Hi,
    I am trying to make a report about the opportunities and their values. I decided to add 3 times the same revenue colomn because I wanted the first colomn to show me the revenus under 10000, the seconde one, the revenues between 10000 and 100000 and the third one, the revenues greater than 100000.
    In order to do that, I selected the function button in the creation of my rapport and I tried it 2 different ways.
    1° I choose the filter button (in the function pop up), select the field on my left panel and choose for the first colomn for example "less than" 100000.
    The formula that appears in this one:
    FILTER("- Revenue Custom Metrics".S_CUR_0+"- Revenue Custom Metrics".S_CUR_0 USING ("- Revenue Custom Metrics".S_CUR_0 < 100000))
    When I try to execute, I get this error message:
    [nQSError: 10058] A general error has occurred. [nQSError: 22034] Aggregate is not allowed within USING clause of a FILTER operator. (HY000)
    SQL Issued: SELECT "- Account Custom Attributes".PICK_3, "- Opportunity Custom Attributes".TEXT_30, "- Revenue Custom Metrics".S_CUR_0, FILTER("- Revenue Custom Metrics".S_CUR_0+"- Revenue Custom Metrics".S_CUR_0 USING ("- Revenue Custom Metrics".S_CUR_0 < 100000)), Opportunity."Current Sales Stage" FROM "Opportunity Analysis"
    2° I try to use the "<" sign without using the filter. So I click on the appropriate colomn and add < 100000, so it becomes:
    "- Revenue Custom Metrics".S_CUR_0+"- Revenue Custom Metrics".S_CUR_0 < 100000
    I receive the following error message:
    [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <<>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: SELECT "- Account Custom Attributes".PICK_3, "- Opportunity Custom Attributes".TEXT_30, "- Revenue Custom Metrics".S_CUR_0, "- Revenue Custom Metrics".S_CUR_0+"- Revenue Custom Metrics".S_CUR_0 < 100000, Opportunity."Current Sales Stage" FROM "Opportunity Analysis"
    Can someone tell me what I did wrong ?
    Thanks a lot

    firstly, didn't understand why you are adding the metric to itself in the Fx.
    secondly, you could have used case when statements, something like CASE WHEN metric <10000 THEN metric ELSE NULL END and so forth

  • How to get 1 day less than user entered date

    Hi
    There is a user entry for date. If the user enters 20060427 then the report should run for 20060426. I tried giving 'LT' in the CMOD code. But it gives an error. Can anyone pls help. Is there a function module for this?
    Thanks
    Suja

    Hi Suja,
    You can use Less Than and Greater than for a user entry variable as follows: When you right click > restrict the char, then in the pop up box there is a drop down for Selection. Choose Value Hange here. Then in the drop down to the right you will have values ike Between, Less Than, Greater than...you can select as required.
    Hope this helps...

  • Less than 180 days Depreciation Calculation process

    Hi
    I would like to calculate the depreciation exactly for >=180 days and <180 days. What all settings I have to do to get the exact days for calculation.
    I have made the settings but its taking April to September for more than 180 days and October to March for less than 180 days.
    I have to calculate it for till 3rd October as cut off for 180 days.
    Thanks and Regards,
    Sarvendra Singh

    Please refer the below
    http://scn.sap.com/thread/3420139
    http://scn.sap.com/thread/2149582
    http://scn.sap.com/thread/718175

  • I have a new 16g nano and I have only added about 600 songs and I only have less than a gig left of space.  It says I have used over 9G of other.  I have no movies, pictures, tv shows or anything else on it.  How do I find out what the "other" is?

    I have a new 16g nano.  I have only added about 600 songs so far.  It is telling me that I 4.47G of songs and 9.92G of other and only 3.297MB of space left.  I have no tvshows, no movies, no pictures on the Ipod.  How do I find out what the "other" is and get rid of it? 

    You most likely have some corrupted files in other. Restore it and resync.

  • Date data from Crystal Report one day less than Date from Source

    Hi,
    I am creating a Crystal Report 4.0 for Enterprise Users (Client Version only) based on a BEx query. I have a field called 'Date' that I am bringing over from the BEx query. It has a format of MM/DD/YYYY. When I view the 'Date' in Crystal Reports, it is displaying as 1 day less from the actual data. For example, in the BEx Query, 'Date' = 11/01/2011.  In Crystal Reports, it is showing up as 10/31/2011, which is one day behind.  I'm not sure what's going on.
    Please help!

    Well, this is as weird as it gets!
    Here are the observations on SP02:
    1) The Date Characteristic is a day off in the report while the 'Key' shows correct date
    2) It displays in the '30.01.2011' (DD.MM.YYYY)format
    3) When you right-click this field to change the date format, the date option is missing
    4) You create a formula to see if this is a date and it returns True. The formula you can try is :
    isdate(). It returns False for any other function like isnumeric() etc
    5) So, this is a date filed, or CR4E thinks this is a date field, however doesn't let us change the format
    6) You cannot use this field with date functions like cdate(); weird!
    7) The only way you can show it the way you want is to write this formula:
    *mid(,4,2)&"/"&left(,2)&"/"&Right(,4)*
    This is still a string field, however displays as MM/DD/YYYY.
    In Crystal Reports 2011, however, the following formula on the same date field returns a date value, meaning you can further right-click this formula field to change the date format like a normal date field:
    cdate(tonumber(Right(,4)),tonumber(mid(,4,2)),tonumber(left(,2)))*
    The same formula, however, throws a 'String is non-numeric error in CR4E and I found that it doesn't like this:
    *tonumber(Right(,4)) ; same error
    I've tried a lot of combinations to make this a date field in CR4E, however none works!
    So, the only option is to use the formula that I mentioned above.
    P.S: If you install Patch 2.10, you'll notice that the Characteristic value shows the correct date. For some reason though, it is in the same format as the 'Key' and if we wish to change the date format, the only possible workaround is to extract the numbers and join like I suggested above.
    Hope this helps!
    -Abhilash

  • How to Measure frequency of less than 300 Hz

    Is it possible to measure frequency without a counter module? All I have is a cDAQ with 9205, 9221 and 9263 modules.

    Hello,
    I am assuming that you want to measure analog frequency, since you have analog input and output hardware.  There is a useful LabView Help file titled Measuring Analog Frequency.  You will be able to measure analog frequency using just software and no counters.  However, this involves using Fast Fourier Transform (FFT) functions that are only available in LabView Full and Professional versions.  Please also take a look at the examples in the Example Finder.  Some helpful ones are titled … Signal Generation and Processing.vi, Spectrum Measurements.vi, and Simple Spectrum Analyzer (sim).vi.  These example’s block diagrams are a little busy, however you can see how they are using simulated signals with the FFT Power Spectrum.vi.  Note that the example titled Spectrum Measurements.vi uses express functions.  These functions are going to involve less programming, but offer lower program efficiency.
    Samantha
    National Instruments
    Applications Engineer

  • Disk Management reporting capacity significantly less than Explorer or Diskpart.exe

    Hi, I'm having some odd issues related to Backups failing due to a lack of space on my server, and think there might be something related to the fact that Disk Management is reporting my main partition size as much smaller than it really is. I'm including
    an image as it's much easier to explain. Basically, Disk Management shows the partition (which is GPT) as 250mb, but everything else shows it correctly as 1.6TB.
    The partitions are left the way the machine shipped from Dell, but I did format it a couple of weeks ago and installed a fresh copy of Windows Server 2012 R2. Sadly I'm not sure if the partitions were like this under Server 2008-- I can't imagine they shows
    up like this as I never had any issues so I don't know. Maybe something in the initial install went wrong and tagged the partition incorrectly?)
    I've tried to do "extend filesystem" in diskpart to no avail. I'm a bit concerned about touching anything and possibly losing data, unless I have to. That said, this server is in production but currently only as a domain controller and could be
    easily demoted and wiped out and started over (with fresh partitions), if I had to. I'd prefer to just figure out a solution to fix this (and hopefully fix the backups in the process since they seem to be running out of space-- as Windows Server Backup only
    sees the 250mb size!)
    Thanks for any ideas!
    Justin

    Hi Justin,
    1.  Have you tried Rescan Disks in Disk Manager: Click Action, and then click
    Rescan Disks.
    2.  I also recommend you to make this disk to connect to other operating system to check if the issue is caused by OS or Disk.
    3.  Have you set space limit on the disk like Quota management.
    4.  Finally, the last method is formatting the disk(please note backup your data before), then reallocate the partition.
    Best Regards,
    Anna

Maybe you are looking for

  • Pass parameter to apex page via the URL

    Hi, I need to pass a parameter into a page that will be used in a query inside a report region, e.g report region query is select link_id, page_id, menu_parent_id, link_text, link_url from portal_pages where page_id = :page_id So the page will displa

  • Ttcwerrors.log and ttcwmesg.log file locations

    Is there an option we can set in the ttcrsagent.options file to change the location of the ttcwerrors.log and ttcwmesg.log files? We can change the location of the daemon user and error log files by setting the -supportlog and -userlog options in tte

  • Nokia E65 big problem had to reset twice in 3 weee...

    Hi all i have had my nokia E65 for 3 weeks now and i have had to turn the phone off and on twice in that 3 week period, why you may ask. when i use my phone its fine but the problem is when i dont use the phone the display go`s dark which it should b

  • Problem importing max configurat​ion

    I would like to import my device configuration file programatically with MAXcopy configuration.vi but when I use it an error appears.  Here are the settings I entered:  source: H:\TEST DEPT LABVIEW FUNCTION TESTER\Labview program\configData.nce desti

  • Mysterious..wooooo.  Not life or death but weird and confusing.

    Hi guys! Just wondering if you guy's know why: 1. My iMac occasionally resets to the lowest Brightness/Contrast setting upon start up. 2. After waking from sleep, the first key I type won't register. (ex. - I wake my iMac and go to Safari. Let's say