473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

NVL Function for Date field

while am executing the following query

select nvl(create_date_time, sysdate)
from bucomments
where lseqno = '19068'
/
even I am using the nvl function am getting the 'no row selected' message.

Help me in this, Thanks in advance.
Oct 4 '07 #1
4 13913
amitpatel66
2,367 Expert 2GB
while am executing the following query

select nvl(create_date_time, sysdate)
from bucomments
where lseqno = '19068'
/
even I am using the nvl function am getting the 'no row selected' message.

Help me in this, Thanks in advance.
Check if you have data for the Iseqno = '19068'
Oct 4 '07 #2
Check if you have data for the Iseqno = '19068'
Yeah, I don't have data for the Iseqno=19068.
well, I need to display for the result as sysdate if records dosen't match with the Iseqno.
Oct 4 '07 #3
amitpatel66
2,367 Expert 2GB
Yeah, I don't have data for the Iseqno=19068.
well, I need to display for the result as sysdate if records dosen't match with the Iseqno.
Well, NVL is a SINGLE ROW FUNCTION which will be executed once for each row. Now if your query does not fetch any record, then the output will be no rows returned.

If you want to display the SYSDATE, particularly for the above Query where Iseqno = 19068, then try the following:

Expand|Select|Wrap|Line Numbers
  1. SELECT create_date FROM table_name WHERE Iseqno = 19068
  2. UNION ALL
  3. SELECT SYSDATE FROM dual
  4.  

The above code might not satisfy your requirement completely, but as per yur request above, it will work!!
Oct 4 '07 #4
Saii
145 Expert 100+
Why do you need a create date as sysdate for a record which does not even exist in table?
Oct 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: EV | last post by:
We have a personnel database that we want to set up...For time off we will have a start date field and an end date field as well as a field for the number of hours. We need to determine how many...
2
by: Andy | last post by:
Hello, I have a question regarding how to format a date in VB so that I can call it from a query and get results. I'm calling functions in the query because that was the only way I found I could...
2
by: fhuntsman | last post by:
1) dhCountWorkdaysA comes from "Visual Basic Language Developer's Handbook" by Ken Getz and Mike Gilbert 2) I place this function and the other functions that are needed for this to work in...
3
by: carl.barrett | last post by:
Hi, I have a number of buttons on a form which run mailmerges. Next to each button is a text box/control that the user enters a date into when the letter was created/merged. When the user...
12
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is...
3
by: Sandman | last post by:
So, I've used ajax for quite some time for different stuff. Mostly I just feed a funktion I made with the ID of the DIV that should be updated with the output from page XXX.php Now I want to...
2
by: John Smith | last post by:
Hello, I have a VB.NET application with a Windows form that have several textboxes fields where I have dates entered. I would like to do a date validation check after the the field is updated, so...
3
by: Ciara9 | last post by:
I am having problems trying to update a field in a database using a field in a form. I currently have two fields, Today and Tomorrow in a table named Date. The Today field automatically defaults to...
5
by: turtle | last post by:
Background: I have a table of fields each field representing a month (Jan, Feb, Mar...). These are not a date field but more of a bucket to hold labor actuals. Along with the months their is...
3
by: murch.alexander | last post by:
I made a simple public function to set and return a date value (see below). I have a number of queries that call up the function to get the "As Of Date," which is typically set to today's date....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.