|
-
Aug 11th, 2000, 11:09 AM
#1
In my proggie, data is imported from a delimited text file to a grid. The primary identifier of each entry is the date; for example, 08/10/2000 as rs.fields(1).
When the imported text is saved to the database, I need to determine if the dates already exist so that the newer data does not create duplicates. Is there a better way than:
Code:
sSQL = "SELECT ACDDate FROM " & sRS & " WHERE [ACDDate] BETWEEN '08/01/2000' AND '08/30/2000'"
And then testing whether the RS is empty or contains recordsets?
Thanks!
-
Aug 11th, 2000, 11:33 AM
#2
Frenzied Member
1) Access will want your dates delimited by "#"
2) when checking for the existience of keys, you want to check at the level of uniqueness; ie; you'd want to look for a single date instead of a range.
for Access you'd want to use:
sSQL = "SELECT ACDDate FROM " & sRS & " WHERE [ACDDate] = #08/06/2000#"
for SQL server you'd want to use:
sSQL = "SELECT ACDDate FROM " & sRS & " WHERE ACDDate = '08/06/2000'"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|