Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 having trouble with a query

Author  Topic 

unnoan
Starting Member

2 Posts

Posted - 2009-08-07 : 18:50:14
Hello, I am having trouble putting this query together. I have to select LoanNo, name, procdate, authdate, disbdate and total number of defaults for all loans that are either paid not on time or have been paid with insufficient amounts.

I used a left join to make a view earlier which i saved as extended statement. this view contains the amtdue, amtpaid, datepaid, and duedate used to tell if the loan was paid on time or with sufficient funds.

the loanNo is in both the loan table and the lender table (which have a relationship through loanno). procdate, authdate, and disbdate are all in the loan table while name is in the lender table.

This is the statement I thought would work but it doesn't:

SELECT le.loanno, le.name, procdate, authdate, disbdate
from lendor le, loan l
where le.loanno = l.loanno and [extended statement].duedate <= [extended statement].datepaid
or le.loanno = l.loanno and [extended statement].amtdue >= [extended statement].amtpaid

it keeps asking me to enter parameter values for loanNo, and the extentended statement data for some reason.


webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-08 : 13:01:03
In SQL Server a query is never asking to enter parameter!
So what are you using to retrieve the data?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

unnoan
Starting Member

2 Posts

Posted - 2009-08-09 : 11:20:24
i am using access 2007. yeah i dont know why it is asking me that, there are values in the DB.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-08-09 : 12:11:09
loanNo is not in one of the tables (or you misspelled it) so MS Access thinks it's a parameter. Double check your query.
Go to Top of Page
   

- Advertisement -