473,490 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

case, nvl and datetime fields

bon
I have a mssql view I am translating to oracle syntax

One of the lines in the mssql view is like this:
DATO=CASE (isnull(loandate,1)) WHEN 1 THEN 'N' ELSE 'Y' END

In other words, the view will return a Y if loandate has a value, N if
it does not have a value

How can I accomplish the same with Oracle9?
Jul 19 '05 #1
2 5874
VC
Hello,

DECODE(loandate, null, 'N', 'Y')

...or

case when loandate is null then 'N' else 'Y' end

Rgds.
"bon" <ma*********@hotmail.com> wrote in message
news:c7**************************@posting.google.c om...
I have a mssql view I am translating to oracle syntax

One of the lines in the mssql view is like this:
DATO=CASE (isnull(loandate,1)) WHEN 1 THEN 'N' ELSE 'Y' END

In other words, the view will return a Y if loandate has a value, N if
it does not have a value

How can I accomplish the same with Oracle9?

Jul 19 '05 #2
bon
"VC" <bo*******@hotmail.com> wrote in message news:<rqoBb.347574$ao4.1164423@attbi_s51>...
Hello,

DECODE(loandate, null, 'N', 'Y')

..or

case when loandate is null then 'N' else 'Y' end

Rgds.


Thanks

I actually did find out a way to do it eventually, but unlike you I
complicated it more than necessary...
(if you are good at reading between the lines, you probably realize
now my real problem was with conflicting data types in my original
attempt to translate it)

CASE nvl(loandate,to_date(NULL)) WHEN to_date(NULL) THEN 'N' ELSE 'Y'
END
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1231
by: fowlertrainer | last post by:
Hi ! I think that I have been found a bug in mx.DateTime... So: I use FireBird, and in this RDBMS the datetime fields are "doubles". So if I set them to 0, the values the fields are '1899-12-30...
7
10836
by: Eddy | last post by:
I have to check whether a given date is between a day and a month. A guided tour is only scheduled from november 1st until april 1st. when i want to make a reservation for the tour Today the query...
2
2859
by: JTWhaler | last post by:
I'm looking for an efficient t-sql script to loop through all user tables in a db and determine/print the value of each row having a datetime field (including cases where there are multiple...
11
3788
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By,...
2
8180
by: Manfred Braun | last post by:
Hi All, I am on listing a class's fields with reflection and I have to handle fields which are array of type DateTime . I cannot get this to work and I get an unexpected run-time exception: ...
2
1604
by: rdraider | last post by:
Hi, We have a lame app that uses 2 datetime(8) fields, 1 stores the date, the other the time. example query: select aud_dt, aud_tm from orders results: aud_dt ...
5
2579
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
7
13319
by: TheLostLeaf | last post by:
DateTime tTime = DateTime.Now; ------------------------------------------------------------------------------------------- tTime returns "1:59:00 PM" it never returns seconds. Database field...
7
35685
by: billygotee | last post by:
Hi, Okay this is taking longer to figure out than I thought it would. The integer members of a DateTime (such as DateTime.Minutes, DateTime.Seconds, etc.) can only get the value, not set it. ...
2
1366
by: Andy B | last post by:
I have a few questions about xml, DateTime conversions and DateTime fields. 1. in the example of DateTime.Now, how would you save it in the format yyyy-mm-ddThh:mm:ssZ for xml storage? 2. If I...
0
6974
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
7183
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...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.