I really hope someone would help me. I had this query:
"Select distinct DVD.DVDid,Rent_Detail.RentNo,Title,Num_of_DVD,(get date()-RentDate)+1 As RentPeriod,(CASE WHEN RentPeriod>5 THEN (RentPeriod-5)*500 ELSE RentPeriod*0 END) As Fine From Member,Rental,DVD,Rent_Detail Where DVD.DVDid=Rent_Detail.DVDid And Rental.RentNo=Rent_Detail.RentNo And Member.MemberID=Rental.MemberID And Member.MemberID='" & ComboBox1.Text & "' AND Rent_Detail.DVDid='" & DGV1.Rows(e.RowIndex).Cells(0).Value & "' AND Rent_Detail.Num_of_DVD>0"
Now my question is, there are error saying that invalid column from 3 RentPeriods in CASE, but I use those just to create a column name "fine". Why is that?