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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 When No Row Exists Return Value
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 02/15/2013 :  09:13:09  Show Profile  Reply with Quote
Im using 2 tables, with the following query:

SELECT Lånernr, Lånernavn, SUBSTRING(CPRNummer, 0, 7) AS Fødselsdag, Allotment
FROM tblLånere
INNER JOIN eaAllotments ON eaAllotments.Lånernummer = tblLånere.LånerNr
WHERE EksamensAnsvarlig = 1 AND Period_id = 17

The issue is that the table allotments not always have a record for a user (låner). I would like to have a null value or something.

Best Regards

Flowing Fount of Yak Knowledge

2242 Posts

Posted - 02/15/2013 :  09:16:03  Show Profile  Reply with Quote
Try this......

FROM tblLånere
RIGHT JOIN eaAllotments

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000