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.
Author |
Topic |
AntonDobs
Starting Member
1 Post |
Posted - 2009-08-07 : 15:18:15
|
Hi, I am currently in a class learning SQL and we are using MS Access for this. The current assignment is giving me some difficulties with just one particular part. The basic idea of the DB is a Guaranteed Student Loan system, and currently having a problem with a datatype being a Char instead of a Single. The professor gave us the model with data types, and I am not sure if by design or oversight he gave us AmtDue as a Single, and AmtPaid as a CHAR(10).The problem is coming in when I have to compare AmtDue with AmtPaid to find defaults. CSng(ep.AmtPaid) AS AmtPaid works wonderfully but in the view there are statements that have yet to be paid (leaving a Null value in the AmtPaid) which throws an Error into the field other than just leaving it blank. When this happens it creates a larger problem when using this new view doing the comparison es.AmtPaid < es.AmtDue I get an error "Invalid use of Null".Any ideas on how to get through this without just thinking the prof is insane and changing the datatype from the get go. |
|
YevS
Starting Member
3 Posts |
Posted - 2009-08-14 : 03:53:01
|
in access:CSng(nz(ep.AmtPaid, 0))in SQL server:cast(isnull(ep.AmtPaid, 0) as float) |
 |
|
|
|
|