dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

how to use if statement in Query - Oracle Database

This is a discussion on how to use if statement in Query - Oracle Database ; SELECT Account.SlNo, Account.Customer, Account.Contract, Account.[Call #], Account.[DD250/DSVL], Account.POP, Account.[Invoice Date], Account.Inv, Account.Amount, Account.Status, Account.Comments FROM Account WHERE (((Account.Customer)=forms!Report!Text13) And IF ( ((Account.Status)=forms!Report!Text35) ) = 'Unpaid' BEGIN ( ((Account.Status)='UnPaid' Or (Account.Status)='Not Paid') ) END ); Actually , i need to to ...


Home > Database Forum > Oracle Database > how to use if statement in Query

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 10-12-2009, 05:42 AM
Database Newbie
 
Join Date: Oct 2009
Posts: 1
sailumichael is on a distinguished road
Default how to use if statement in Query

SELECT Account.SlNo, Account.Customer, Account.Contract, Account.[Call #], Account.[DD250/DSVL], Account.POP, Account.[Invoice Date], Account.Inv, Account.Amount, Account.Status, Account.Comments
FROM Account
WHERE (((Account.Customer)=forms!Report!Text13) And IF ( ((Account.Status)=forms!Report!Text35) ) = 'Unpaid'
BEGIN
( ((Account.Status)='UnPaid' Or (Account.Status)='Not Paid') )
END );

Actually , i need to to get unpaid and not paid records from the table "Account", Status is getting from the textbox at runtime, how can i write the above code , it is giving error ( I'm doing this in MS- Access)
Reply With Quote
  #2  
Old 10-20-2009, 01:21 AM
Database Newbie
 
Join Date: Oct 2009
Location: India
Posts: 27
giteshtrivedi is on a distinguished road
Default Re: how to use if statement in Query

Hi,

What is the error code you got.
__________________
Thanks and Regards,
Gitesh Trivedi
Dbametrix Solutions
Reply With Quote
  #3  
Old 07-08-2010, 06:08 AM
Database Newbie
 
Join Date: Jul 2010
Posts: 1
ascondetective is on a distinguished road
Default Re: how to use if statement in Query

if statement can be used in a sql query. i m giving here an example, try it:

select * from table if name='ascon';
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
scope of a query plan Database Administrator sybase 7 10-23-2008 04:39 PM
Query execution time - MySQL Database Administrator mysql 7 05-14-2008 10:52 AM
[GENERAL] unexpected results with NOT IN query Database Administrator postgresql 0 03-20-2008 10:50 AM
Select statement query Database Administrator ms-sqlserver 1 01-29-2008 10:48 AM
query filling tempdb.. Database Administrator sybase 8 11-29-2007 03:09 PM


All times are GMT -4. The time now is 07:55 AM.