Return dates even if no value in field

B

BB

Hi there,

I have to query a database by name and date of birth and
return records that contain that name and date of birth,
but I want the name record to return if either the date of
birth matches, or there is no value in the date (as many
records were added without a date of birth). Is this
possible?

Thanks,
BB
 
L

Lynn Trapp

Try something like this:

Select * from YourTable
Where [NameField] = [Enter A Name]
AND ([DOB] = [Enter A Date] Or [DOB] Is Null)
 
B

BB

Ok, thanks. That makes sense, I'll give it a try.
-----Original Message-----
Try something like this:

Select * from YourTable
Where [NameField] = [Enter A Name]
AND ([DOB] = [Enter A Date] Or [DOB] Is Null)

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi there,

I have to query a database by name and date of birth and
return records that contain that name and date of birth,
but I want the name record to return if either the date of
birth matches, or there is no value in the date (as many
records were added without a date of birth). Is this
possible?

Thanks,
BB


.
 
L

Lynn Trapp

I hope you get it to work. Feel free to post back if you have any questions.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


BB said:
Ok, thanks. That makes sense, I'll give it a try.
-----Original Message-----
Try something like this:

Select * from YourTable
Where [NameField] = [Enter A Name]
AND ([DOB] = [Enter A Date] Or [DOB] Is Null)

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Hi there,

I have to query a database by name and date of birth and
return records that contain that name and date of birth,
but I want the name record to return if either the date of
birth matches, or there is no value in the date (as many
records were added without a date of birth). Is this
possible?

Thanks,
BB


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top