PC Review


Reply
Thread Tools Rate Thread

Converting Oracle SQL functions to Access built-in functions

 
 
GVR_Mike
Guest
Posts: n/a
 
      29th Jun 2006
I have some Oracle SQL code that was sent to me by one of our
programmers. We have an Oracle back-end. We use Access to query Oracle
but the programmers use Oracle directly obviously. I'm trying to
convert his Oracle functions to Access built-in functions without
having to delve into the VBA. I got most of them converted (UPPER,
TO_CHAR, DECODE, etc) but am having trouble finding a way to convert
the LAST_DAY function. Is there a way to use Access built-in functions
to obtain the last day of a given month? I've seen ways to do it in VBA
but want to avoid that if possible.

Thanks.

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      29th Jun 2006
I don't know Oracle, so I don't know what you pass to the LAST_DAY
function.

If you've got a date, and you want the last day of the month that that day
is in, use

DateSerial(Year(MyDateValue), Month(MyDateValue) + 1, 0)

If you've only got a month number, you have a bit of a problem. For all
months but February, you can use DateSerial(2005, MonthValue + 1, 0).
However, what do you want for February: 28 or 29?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"GVR_Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have some Oracle SQL code that was sent to me by one of our
> programmers. We have an Oracle back-end. We use Access to query Oracle
> but the programmers use Oracle directly obviously. I'm trying to
> convert his Oracle functions to Access built-in functions without
> having to delve into the VBA. I got most of them converted (UPPER,
> TO_CHAR, DECODE, etc) but am having trouble finding a way to convert
> the LAST_DAY function. Is there a way to use Access built-in functions
> to obtain the last day of a given month? I've seen ways to do it in VBA
> but want to avoid that if possible.
>
> Thanks.
>



 
Reply With Quote
 
 
 
 
Albert D.Kallal
Guest
Posts: n/a
 
      30th Jun 2006
You do realize that if you use a pass-through query from ms-access, and then
all of your oracle syntax and functions will work from the query in
ms-access?

We are talking about linked tables from ms-access to oracle...right?

If yes, then can you use a pass-through....you will NOT have to modify the
sql, and can leave it in oracle syntax....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)
http://www.members.shaw.ca/AlbertKallal

"


 
Reply With Quote
 
GVR_Mike
Guest
Posts: n/a
 
      30th Jun 2006

Hmmm....interesting, have never used pass-through queries so I didn't
know what they did. I'll research them a little and see if I can get it
to work. Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access 2002 SQL to Oracle 9 PL/SQL MartinX Microsoft Access Queries 1 31st Jan 2007 11:59 PM
MS Access 2002 SQL to Oracle 9 PL/SQL MartinX Microsoft Access 0 13th Dec 2006 02:51 PM
Oracle SQL vs. Access SQL =?Utf-8?B?S2lyayBQLg==?= Microsoft Access Queries 5 19th Apr 2005 01:03 AM
Converting from SQL to Oracle =?Utf-8?B?bHlubg==?= Microsoft Access Forms 2 22nd Jan 2004 12:56 PM
How to connect oracle 8i when oracle 8i and oracle 9i installed in one system Prasad Microsoft ADO .NET 0 1st Dec 2003 11:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:15 AM.