473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Comparing data in two tables to find missing records

I have used the script

"select *
from Titles
where not exists(select * from Descriptions where Descriptions.isbn =
Titles.isbn)"

Need to know if i can restrict it to a date range as well.

eg "and date_u > 2011-08-01"
Aug 17 '11 #1
6 1031
gpl
152 100+
what happened when you tried it?
Aug 17 '11 #2
Hi it still provided all the records. I am not sure where to include the clause as the examples i have seen show it in the brackets.
Aug 17 '11 #3
Rabbit
12,516 Expert Mod 8TB
You put it in the where clause. But since it's a date, you'll need to put it in single quotes and it'll do an implicit conversion. Depending on your localization, you may need to change the format that you use. Where I am, I have to put dates in mm/dd/yyyy format.
Aug 17 '11 #4
ck9663
2,878 Expert 2GB
Also, depending on which table has the column "date_u", you might need to use an alias to qualify which column from which table you are referring to.


Happy Coding!!!

~~ CK
Aug 17 '11 #5
Hi

Thanks for the replies so far most appreciated.

I tried the following format but it still extracts all records.

( and t1.dat_u >= '2011-08-01')
Aug 18 '11 #6
Rabbit
12,516 Expert Mod 8TB
If that's actually what you put, then it shouldn't even run. It would error out.

This is incorrect syntactically
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM tableName
  3. WHERE criteria (and criteria)
You have to drop the parentheses or else it will error out. But because it ran, I suspect that's not what you actually put in your SQL.

It also shouldn't run because you are using an alias or qualifier that does not exist in the original SQL you posted.

Without what you're actually using as your SQL, we can't help you. What you're posting can't even run yet you're saying it's returning results.
Aug 18 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bill | last post by:
I have two tables of book information. One that has descriptions of the book in it, and the isbn, and the other that has the book title, inventory data, prices, the isbn. Because of some...
22
by: Bryan Guilliams | last post by:
I'm trying to come up with an elegant, simple way to compare two consecutive values from the same table. For instance: SELECT TOP 2 datavalues FROM myTable ORDER BY timestamp DESC That...
4
by: SQLJunkie | last post by:
Here is an issue that has me stumped for the past few days. I have a table called MerchTran. Among various columns, the relevant columns for this issue are: FileDate datetime , SourceTable...
3
by: brian kaufmann | last post by:
Hi, I had sent this earlier, and would appreciate any suggestions on this. I need to make calculations for unemployment rate for three different data sources (A,B,C) for many countries and age...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
3
by: fong.yang | last post by:
I have tried to use the query wizard to find unmatched records but it doesn't seem to be going right. The results are still giving me some records that are in both tables. I have two tables...
1
by: anonymowho | last post by:
this is what I am trying to do. I have 2 tables in 2 different databases in 2 different directories. so my first table is called CUSTOMER in the database PROD and in the directory...
1
by: shalini0702 | last post by:
Hi, I have Missing Records when exporing a table from (msaccess) One database to another. Supppose My Db has 10 tables and expoting all the table from One database to another was correct. ...
11
by: jennifersalcido | last post by:
Hello All, I am working with two tables that contain inventory data: 1) INVENTORY contains item_number, description, etc. This data is relatively straight-forward, one record per item_number....
6
by: raamay | last post by:
i recently formatted my pc where sql server 2000 was installed. I backed up my db and then restored it after formatting. But today i came to know that all the recent records are lost (may be because...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.