Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHERE statement causing hassles

Status
Not open for further replies.

Schnappa

Technical User
Jul 27, 2003
58
0
0
AU
Hi again all

Still learning, still making mistakes. Can anyone please tell me where I am going wrong with this coding. Its the WHERE clause that's causing me grief.

Thanks

Gez

CREATE TABLE [AccountLoanTEST] (
[AccountID] char (12) NOT NULL,
[LoanStatus] char (20) NULL,
[UndisbursedAmount] numeric (21,6) NULL,
[RepayAmount] numeric (21,6) NULL,
[RepayFrequency] char (8) NULL,
[RepayInterFrequency] smallint NULL,
[DelinqAmount] numeric (21,6) NULL,
[AdvanceAmount] numeric (21,6) NULL,
[RepayStatus] char (20) NULL,
[ApplicNumber] char (20) NULL,
[AmountFinanced] numeric (21,6) NOT NULL,
[DateSecuritised] smalldatetime NULL,
[MethodDesc] char (20) NULL,
[BrokerFlag] bit NULL,
[PurposeDesc] varchar (25) NULL,
[Term] smallint NULL,
[ReviewDate] smalldatetime NULL,
[DateLastFunded] smalldatetime NULL,
[MaturityDate] smalldatetime NULL,
[ApprovalOfficer] varchar (40) NULL,
[PartialPriority] char (11) NULL,
[LoanRateType] char (15) NULL,
[OldAccountNumber] varchar (15) NULL,
[LinkedSavingsAccountID] char (12) NULL
)
_____________________________________________

ln_display.acct_no AS AccountID,
ln_display.undisbursed AS UndisbursedAmount,
ln_display.nxt_pmt_amt AS RepayAmount,
ln_pmt_schedule.period AS RepayFrequency,
ln_pmt_schedule.trm AS RepayInterFrequency,
ln_display.delq_amt AS DelinqAmount,
ln_display.in_advance AS AdvanceAmount,
ln_user_defined.value AS ApplicNumber
WHERE ln_user_defined.user_defined = 5,
ln_display.amt_financed AS AmountFinanced,
ad_ln_purpose.purpose AS PurposeDesc,
ln_display.trm AS Term,
ln_acct.nxt_rev_dt AS Reviewdate,
ln_display.contract_dt AS DateLstFunded,
ln_display.mat_dt AS MaturityDate,
ad_gb_rsm.name AS ApprovalOfficer,
ln_acct.partial_priority AS PartialPriority,
ln_acct_int_opt.rate_type AS LoanRateType,
ln_acct.acct_no_old AS OldAccountNumber,
ln_acct.chg_alt_acct_no AS LinkedSavingsAccountID
 
What are you trying to do here? Looks like an insert to your created table?

Create table looks ok, but below the line I get lost.

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Alex

Thanks for the reply to this one. I have been on holidays and noticed your reply. I ended up changing my procedures, so the questions became redundant.

Many thanks for the time spent in the reply.

Cheers

Gez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top