How to handle empty dates

In my form, the user can select a date of beginning and final search, a text field to search, or both dates and the text field to search for. Here's what I have:

< b >
< td align = "center" colspan = "2" >
< font = "3" face = "Arial, Helvetica, sans-serif" size = "003366" color >
< b > Date: < /b > < / make >
< input type = "text" size = 11 name = "fromDate_value" value = "" >
< a href = "javascript:show_calendar4('document.getPSDocs.fromDate_value',_document.getPSDocs.fromDate_value.value)" >
< img src = "calendar.gif" width = "25" height = "25" border = "0"
ALT = 'Click here for the Date stamp' > < / a >

< font = "3" face = "Arial, Helvetica, sans-serif" size = "003366" color >
< b > to date: < /b > < / make >
< input type = "text" size = 11 name = "toDate_value" value = "" >
< a href = "javascript:show_calendar4('document.getPSDocs.toDate_value',_document.getPSDocs.toDate_value.value)" >
< img src = "calendar.gif" width = "25" height = "25" border = "0"
ALT = 'Click here for the Date stamp' > < / a >
< table >
< /tr >
< b >
< td colspan = "2" >
< table >
< /tr >
< b >
< td colspan = "2" align = "center" >
"" < img height = "3" src = "... / images/rule_navyH4W760Solid.gif" width = '759' border = '0' >
< table >
< /tr >
< b >
< td colspan = "2" >
< table >
< /tr >
< b >
< td align = "center" colspan = "2" >
< font = "3" face = "Arial, Helvetica, sans-serif" size = "003366" color >
< b > choose a request number: < /b > < / make >
< select name = "search_type" >
< option value = "Contains" > Contains < / option >
< option value = "begins by" > begins by < / option >
< option value = "ends with" > ends with < / option >
< option value = 'East' > < / option >
< option value = "is not" > not < / option >
< option value = "Before" > before < / option >
< option value = 'After' > after < / option >
< / select >

< input type is "text" name = "prNumber" required = "Yes" message is "Request number must be entered to search" >
< table >
< /tr >
< b >

On the page of my action, I build the query based on the search criteria. Here's what I have so far:

< cfquery name = "getPRNum" datasource = "docuTrack" >

SELECT *.
OF dbo.psFileInventory

< cfif form.search_type is 'Contains' and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber like '% #form.prNumber#% '.

< cfelseif form.search_type is "begins by" and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber like '#form.prNumber#% '.

< cfelseif form.search_type is 'Ends with' and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber like ' % #form.prNumber #

< cfelseif form.search_type "is" and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber = ' #form.prNumber # '.

< cfelseif form.search_type is "Is not" and is not form.prNumber "" > "".
Where dbo.psFileInventory.prNumber <>' #form.prNumber # '.

< cfelseif form.search_type is 'Before' and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber < = ' #form.prNumber # '.

< cfelseif form.search_type is 'After' and form.prNumber is not "" > "".
Where dbo.psFileInventory.prNumber > = ' #form.prNumber # '.
< / cfif >


< cfif form.fromDate_value is not ""and this is not form.prNumber"" > ""
And fileDate between #CreateODBCDate (form.fromDate_value) # and #CreateODBCDate (form.toDate_value) #.
< cfelseif form.fromDate_value is not ""and form.prNumber"" > ""
Where fileDate between #CreateODBCDate (form.fromDate_value) # and #CreateODBCDate (form.toDate_value) #.
< / cfif >

order of prNumber
< / cfquery >

I did see to see what has been select so that I can use similar, not like, etc... Then I check to see if there is a date value so that I can learn to use AND in the select statement.

If both the field and the dates are selected, so we could select where xxxx and date...
If the field is selected only, then we could select where xxxx
If the date is selected only, it would be more select the date where xxxxxx

The problem is when I check for date is "" in the cfif statement, get error on null values. So I check for date is null or is not null, but this still does not work. It works find when I check for both the field and the date is not "", then I can use AND, but when I try to check for any what other combinataion, I get error NULL.

How can I fix?

Trojnfn wrote:
In addition, using your method, how can I get the date in the query?

My suggestion is to a block of code that does not involve the date. In any case, here's an idea. It is based on advice from Efecto747 isDate.

Tags: ColdFusion

Similar Questions

  • How to handle big data pipes

    Hello gurus of the forum!

    I am a student in engineering who recently committed the responsibility of the overhaul of a system of control of microscope. I chose to use as a basis for the Machine of State JKI. But I ran into a problem with my data stream management.

    In the old version of the program, I had many sons in the main towers in all directions, modified through screws and just solicited by others. (see States of Spaghetti Machine).

    What I want to do is to group the data stream to a big fat pipe (wire). This clean my Main.vi well and make it easier to include specific variables (instead of looking for the single correct thread TAPI in the main.vi). The problem is that it seems really difficult change specific variables due to the number of tables in arrays in arrays. (see Pipeline). For example, if I wanted to update/change the type of data U32 located in the heart > exit Setup > output Config camera > buffer, how could I do without unbundling all then set up in the back?

    Maybe I'm doing this all wrong and there are better ways to manage the flow. in any case, I would like to know what you think!

    Thanks for your time,

    Sam

    OK, I feel a bit stupid, I just discovered that bundle by name allows to update a specific portion in a stream of large size... (see image)

    @TiTou: Yes that's what I mean

    And Yes, everything in one single thread for reunification is probably a bad thing. I'll group them by category/use, but they are still going to be very big. And management which was what was worrying me, but this is no longer a problem

  • How to handle the data type DECIMAL MySQL converted to DOUBLE in OBIEE 10 gR 3?

    Hi all

    I have a problem in OBIEE 10g to I use the MySQL database as datasource direct to the server of the OBI and I have a column in a MySQL table which was designed as the DECIMAL data type (18.0).
    This column is used to measure a length, and values are included in seconds (without decimals), in the form as:
    "1200"
    in the MySQL database.

    After the import of the MySQL table associated with the repository of the OBI, the OBIEE converts the DECIMAL data type column to the DOUBLE PRECISION data type automatically.

    My goal is to reach the values in this form, certainly in the sense of the term (not at the time!):
    hh mm ss

    In order to accomplish, I tried to change the format of column with the ROUND function:
    ROUND (db.table.column / * 3600 * 2)

    The problem is that it doesn't work well if values can be divided with no rest for example
    original value: 7200
    new value (ROUND): 2

    In the case of my example:
    original value: 1200
    new value (ROUND): 0
    It's false, because 1200 seconds are not equal to 0 hours, I want to see two hours of _0.33333_ OR I much prefer more _0 hour 20 m_

    Anyone have any ideas?
    I tried to make a view of database and importing that type of CHAR data in the database, but is not the solution too, because if I filter BI app or try to make a SUM the BI would drop errors...

    Kind regards
    Laszlo

    Hello
    SE refer to this link, it is exactly will meet your need.

    OBIEE 11 g - change seconds in the format hh: mm: DD
    OBIEE functions

    Share updates... :)

    check if useful/correct...

  • Model of how APEX handles data (values)?

    Reference {: identifier of the thread = 2486655}

    I am trying to get a model of how APEX handles data (values). There are several places (?) data (values) that may exist. Or so it seems. I'm trying to understand how these work - to put all the pieces together.

    Question:
    (A) where data can be?
    (1) in the database
    (2) for the session
    (3) rendering - and then displayed on the screen, if a value displayed - but not in the session
    (4) in perhaps (?) a few (?) memory work pool but different from the rendered page of values, I see on the screen?
    (5) other?

    Why I think that it's relevant?
    Question:
    (B) attended the session different from that made, then when the code runs, the values and values that (rendering or session) if he runs against?

    And maybe the answer is, "You don't understand what is happening." Yes, "exactly!" Where the question.

    Best wishes
    Howard

    Hello

    If you like to have 'default value' in session state, use the calculation.
    And as you've noticed, you need to before calculation of the item is made to get the same "default" session state and the screen.

    Kind regards
    Jari
    -----
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • How to manage the Data Association output when no line not returned?

    BPM 11 g, I use a Service to select a line in an external database in passing a parameter using a database adapter.  Works fine when a row is returned.  But if no row is returned (which can happen, because no match is not found on the selection based on the value of the parameter), I get an error on the composite as output data Association has return values, including integers, mapped to a data object, I defined in the process.  Well, if no row is found, the integer value is empty and mistakes to try to save him.

    How to handle this situation?

    The specific message is:

    The expression bpmn:getDataOutput('wm91AInterfaceMainCollection') / ns:Wm91AInterfaceMain [1] / ns:board is empty. An attempt to read or copy the referenced data or calculated by the XPath generated invalid data, according to the XML schema, or did not contain some optional data. Ensure that the variable result or expression named in the error message is not empty. Enable related data elements XML schema validation for the enforcement data are valid.

    I must be missing something obvious here, but can't find a way to handle this.  Thanks in advance!

    Hey Joe,

    Of course, others will be have another idea, but opt for the XSLT option for mapping your data.  Using XSLT, you can check for null in an 'if '.

    Dan

  • during an update lots of my profile folder has been put in a folder on the desktop marked the old data. How to restore this data file

    During a bet to update, automatic update of windows has started and some how much my profile data has been removed and stored in a file on the desktop. There is a simple and easy way to restore this folder from the current firefox?

    You can use the contents of the Old Firefox Data folder to "roll back" the refresh, but this involves several steps. It's probably even faster than the recovery of individual files and load those into your new profile.

    Check in the folder 'Old data Firefox' update adds a folder with a random semi name on your desktop. If there is only one, that probably has your old settings and Add-ons. If there is more than one, you'll want to work with one who has been updated recently.

    Once you have identified the profile folder, that you want to restore, here is my "old profile resurrection suggested procedure:

    Overview

    Here are the steps described in more detail below:

    1. Create a new Firefox profile
    2. Delete all of this profile folder
    3. Copy in all of the old profile folder

    Create a new profile for Firefox (Windows)

    Exit Firefox completely and start up in the Profile Manager by pasting the following in the Windows search, or the Run dialog box by pressing ENTER:

    firefox.exe -P
    

    Note: any time want to switch profiles, exit Firefox and return to this dialog box.

    Click on the button create a profile, give it a name like OldSettings and skip the option to change the location of the folder. Select the new profile from the dialog box, and then start Firefox.

    Open the new profile folder in Windows Explorer

    Firefox in the new profile should look like a new installation of the plant. Open the troubleshooting information page by using either:

    • button "3-bar" menu > "?" button > troubleshooting information
    • Menu help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table, click on the view file"" button. Firefox will launch your new profile folder in Windows Explorer.

    This folder open, switch back to Firefox and get out by using either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Firefox is closed, the profile folder must be front and Center, or you can activate it by using the taskbar.

    Copy old data instead of new

    In this new profile folder you just popped open - NOT the one on your desktop - select all content (you can use Ctrl + a) and delete (you can press Delete on the keyboard).

    Leave this window open, open or switch to your folder of old data of Firefox. Consult your old profile folder. At this level, you should see a folder named bookmarkbackups among other things.

    Select all (Ctrl + a) and copy (or right-click > copy or Ctrl + c).

    Switch to the empty profile folder in another window and paste (or right-click > paste or Ctrl + v). This may take a few minutes because some files are large.

    Launch Firefox

    Firefox should start in this 'new' profile with the old resurrected profile data. Success?

  • How can I empty trash 'Genius '?

    10.7.5, old 32-bit Macbook Pro OSX.

    The Genius bar went yesterday to resolve a problem.  During which, the genius deleted all my music, photos and movies by being connected with a disc of Triage and the magic Apple Genius ID.  He stopped at the command "Empty trash" because he took long (approx. 300 GB of data).  Now, my drive is missing that much space.

    Any ideas how can I empty the Recycle Bin or restore these files?  (Short to return to the Apple store?)

    Thanks in advance...

    You have a backup, if so what kind? It may be interesting to restore if you have a recent backup. Otherwise I would like to backup now if you have a spare drive to use-

    even in this State. At least you have a copy if it fails to restore the Recycle Bin.

    Have what problem you tried to bring to the store? I have to wonder if start over again with a fresh install is a better option?

    It is possible to "put the files"...

    Select an item in the Recycle Bin, right click (or use ctrl + click). In the menu that appears, select 'Put back'. It may not be an option (I don't remember which version added this feature, I think that it was 10.6).

    It is available "back" may not restore all the files and some files may already have been recreated in the old location (existing preferences for example).

    I fear this is can be a messy situation to fix.

    It might be easier to restore files from a different user account, where the need for a backup. If you don't know consider the Apple store again for help, but I guess that this situation is a bit difficult for you.

    See if others here have a better idea too, it is better not to act too quickly in situations like this, unless you have copies of the data on another.

  • My drive is almost full, how can I empty it

    hard disk almost full how can I empty it

    Please download the program TreeSizeFree [1] and run it. It shows you which folders use the entire space.

    You are able to locate the folder that uses less space? Now, open the folders and look if you need data. If this is not the case, delete them.

    André

    [1] http://www.jam-software.com/treesize_free/ "a programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • How to handle the onTriggered many ActionItem created dynamically

    Hi, I created the ActionItem dynamically using (loop)

    because data is from webservice

    How to handle the onTrigerred?

    If my code is like this:

    for (int i = 0; i)< alist.count();="">

    {

    My page page * = iRoot-->findChild ("SpecificObject");
    ActionItem * action = ActionItem::create () .title (aList [i] .name);

    bool res = QObject::connect (action, SIGNAL (triggered ()), this, SLOT (handleAction (())); what I'm confused because I don't know what action is triggered
    Q_ASSERT (res);
    Q_UNUSED (res);

    my page-> addAction (action, ActionBarPlacement:efault);

    }

    MyClass::handleAction() Sub

    {

    aFunction(); This parameter of function required of aList, said user.user aList [i]

    }

    Do I need to create handleAction() as well as added actionItem SLOT

    But I don't know how much action added because it is dynamic server

    Thank you

    There are a few options:

    Create a single location and connect all the signals. You can then call sender() into the slot to retrieve the object that sent the signal and go from there. You can also use a QSignalMap that maps each signal to a value and send this value to a single location. You can also use QSignalMap::sender() to get the sender object.

    I used the QSignalMap to do something similar for handling created dynamically successfully drop-down lists.

  • How to programmatically Exchange data (key-value pairs) with operating system called?

    Hi all

    Is there a programmatic way to Exchange data (of the key-value pairs) with the guest OS?

    We have an application that runs inside comments, and we want that this application in order to use this mechanism to Exchange data. At this point, the guest have no network connectivity. One thing that might work for us is to use the registry to the guest operating system. But I'm not sure how to handle the registry of the guest operating system.

    We looked in the VirtualMachineConfigInfo.extraConfig property, but these key-value pairs are not accessible from the comments (at least this is what I know)

    any ideas?

    Thank you

    Onur

    I think that it is better to use an environment variable or file to Exchange data with the guest operating system.

    http://www.doublecloud.org/2012/03/set-environment-variables-in-guest-operating-system-on-VMware/

    http://www.doublecloud.org/2012/03/read-environment-variables-in-guest-operating-system-on-VMware/

    If you really want the registry value,

    http://www.doublecloud.org/2012/02/run-program-in-guest-operating-system-on-VMware/

    http://en.Wikipedia.org/wiki/Windows_Registry#Command_line_editing

    Good luck!

    Steve, author of the Open Source, VMware VI and vSphere SDK VI Java API

  • empty data file with special characters in the name

    Hi all

    I'm having a problem with an empty data file which is in recovery mode.

    Before the following has been a success:
    ALTER database create datafile 'fully_qualified_file_name' as 'fully_qualified_file_name ';
    recover data file "fully_qualified_file_name";
    ALTER database datafile 'fully_qualified_file_name' online;

    But this time it does not work as I get an error:
    ORA-01516: file nonexistent journal, data file, or temporary file
    Using the file id does not work either.

    When I created a record of control file I see the data file has special characters in the name:
    ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'

    Since it is empty, it would be possible to create the data file void anothr
    using the:
    ALTER database create datafile ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'
    as ' / oracle/PRD/spdata2/r3i_8/r3i.data8';

    and then recover datafile 'fully_qualified_file_name ';
    ALTER database datafile 'fully_qualified_file_name' online;

    How orders oracle faced with special characters?

    Thanks for your advice

    user6737818 wrote:
    Hi all

    I'm having a problem with an empty data file which is in recovery mode.

    Before the following has been a success:
    ALTER database create datafile 'fully_qualified_file_name' as 'fully_qualified_file_name ';
    recover data file "fully_qualified_file_name";
    ALTER database datafile 'fully_qualified_file_name' online;

    But this time it does not work as I get an error:
    ORA-01516: file nonexistent journal, data file, or temporary file
    Using the file id does not work either.

    When I created a record of control file I see the data file has special characters in the name:
    ' / oracle/PRD/112_64/dbs/PSPR3I ^? ^?'

    It should work using a file as the definition of source file number and a new name for the new file. Works for me:

    orcl> alter database create datafile 7 as 'c:\tmp\newname.dbf';
    
    Database altered.
    
    orcl>
    
  • How to handle stale Stats script.

    Hello
    I use Release 10.2.0.1.0 Oracle. I have a scenario where I'm mediocre execution due to obsolete statistics plans, and how do I address the scenario. Here's the part of my main request which deviates the path of execution by the bad cardinality estimate.
     
          My column c1 of table tab1 holds javatimestamp values i.e. its NUMBER datatype which points to a date and time component only. And we gather stats each weekend on this table tab1.
          below is my query:
          
          select /*+gather_plan_statistics*/* from tab1          
          where c1 BETWEEN 1346300090668 AND 1346325539486    ;      
    
    Plan hash value: 3167980259
    
    --------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    --------------------------------------------------------------------------------------------------------------------------
    |   1 |  TABLE ACCESS BY INDEX ROWID| tab1                    |      1 |   1    |    167K|00:01:13.72 |     158K|  12390 |
    |*  2 |   INDEX RANGE SCAN          | IDX_N1                  |      1 |   1    |    167K|00:00:13.27 |   13880 |   1736 |
    --------------------------------------------------------------------------------------------------------------------------
          
         Above shows a big gap in actual and estimated cardinality estimation, and its due to the fact that the HIGH_VALUE (1346203206173 points to 8/29/2012 1:20:06 AM) in DBA_TAB_COLUMN for     column C1 is well below  the STARTRANGE(1346300090668 points to 8/30/2012 4:14:51 AM) and ENDRANGE(1346325539486 points to 8/30/2012 11:18:59 AM) of the BETWEEN clause. 
         
         So even gathering stats daily on the table wont help me as because, in morning again it will require updated maxvalue for the column C1 for estimating proper, So how to handle this situation?  Dont want to go with 'hint' , want to make the stats proper so that optimizer will automatically pick the right path.
    Published by: 930254 on August 30, 2012 04:41

    930254 wrote:
    Yes, I think that of the two options as

    1. setting the High_value (high_value + 7 days ahead) in weekend work which is used to gather statistics on that table.
    2. addition of indication to follow the optimal path.

    y at - it of the other alternatives for this scenario? If this isn't the case, which will be advised of the option above?

    Published by: 930254 on August 30, 2012 06:46

    If you consider the Doms tips as well, theres "a piece of work, you need to make sure that the optimizer always uses the index that it could not properly high_value far out of reach since the last gathering"

    What is the best way to do it? Although you seem reluctant to do it, for me, it's the index indicator. You know that the index, it's what you want to use, it's a small change. All the others, although not terrible difficult to implement, need additional jobs in

  • How to create several data on local storage scsi stores

    Hi all

    If you have a host ESX 3.5 local scsi storage with how you create multiple data warehouses. I would like to create 2 data warehouses. One for my virtual machine and one for my ISO. I tried 2 partitions VMFS3 partitioning at the time of the creation of ESX but when I remove the storage to rename it it only allow me to create 1 data store? Is this possible?

    Is there a downside to simply create a folder in 1 ISO called data store and empty my iso files it?

    I would also like to point out that I have only 1 raid controller

    you will need to manually partition the free space of the Service Console using fdisk.

    If its only for a store, I wouldn't bother.

    Just create a folder like you said yourself, without inconveniences, except that you have to watch out you don't fill your data with the ISOs and other stuff store.

  • How to handle null values in the RTF models

    Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the model that I used the code to print a section below or not.

    <? If: number (CF_ELE_CNT + CF_ELE_CNT1) > 0? >

    The problem is when no data in the second group it was created not the tag XML for CF_ELE_CNT1, if CF_ELE_CNT has 13, it does not always print this partucular article. If I remove the CF_ELE_CNT1 in the State, it works fine. I was wondering how to handle this.

    Any help would be appreciated!

    Thank you
    RAV

    Hey Rav,.

    Check my profile, you will find.

    purpose of fusion {point} [AT] gmail [dOt] com

  • How to handle nulls through oracle forms?

    Hello

    I have a column check box on the form (request mode) and it always display the check box selected even underlying column is null.

    Please can tell me how can I show checkbox only enabled when colum data has value Y and all other cases should be unchecked (even with null values from database)

    Thank you
    VB

    VB,
    Make sure that you set the following properties of the checkbox.

    * Functional
         * Value when checked = 'Y'
         * Value when unchecked = 'N'
         * Check box mapping of other values = 'Unchecked'  (Default = Checked)
    * Data
         * Initial Value = 'N'
    

    The important property is the 'check box, mapping of other values". This property indicates how to handle values that are not expected to Oracle Forms. This is what causes the box to be checked when the value is NULL.

    I hope this helps.
    Craig...

    If a response is appropriate or useful, please mark accordingly

Maybe you are looking for