Getting NoMatch when there should be a match!

DataMiner

Registered User.
Local time
Today, 20:03
Joined
Jul 26, 2001
Messages
336
Here is a sample of my table. Field1 datatype is Memo.
ID Field1
75244541 ----------------------
75244542 1/25/2009 11:04:49 PM
75244543 Database: A
75244544 GetFileSize
75244545 Source: none
75244546 Err# none
75244547 ----------------------
75244548 1/26/2009 12:04:49 AM
75244549 Database: B
75244550 GetFileSize
75244551 Source: none
75244552 Err# none
75244553 ----------------------
75244554 1/26/2009 12:19:49 AM
75244555 Database: C
75244556 Starting TaskSuccess(PCA2kDaily)
75244557 Source: none
75244558 Err# none
75244559 ----------------------

Here is a query on that table:
select id,field1,cdate(iif(isdate(field1),cdate(field1),#1/17/55#)) as dDate from accesslog order by id

And a sample result from the query:
id field1 dDate
75244541 ---------------------- 1/17/1955
75244542 1/25/2009 11:04:49 PM 1/25/2009 11:04:49 PM
75244543 Database: A 1/17/1955
75244544 GetFileSize 1/17/1955
75244545 Source: none 1/17/1955
75244546 Err# none 1/17/1955
75244547 ---------------------- 1/17/1955
75244548 1/26/2009 12:04:49 AM 1/26/2009 12:04:49 AM
75244549 Database: B 1/17/1955
75244550 GetFileSize 1/17/1955
75244551 Source: none 1/17/1955
75244552 Err# none 1/17/1955
75244553 ---------------------- 1/17/1955
75244554 1/26/2009 12:19:49 AM 1/26/2009 12:19:49 AM
75244555 Database: C 1/17/1955
75244556 Starting TaskSuccess(PCA2kDaily) 1/17/1955
75244557 Source: none 1/17/1955
75244558 Err# none 1/17/1955
75244559 ---------------------- 1/17/1955

I am trying to convert the memo field to a date, where applicable, so I can then search the field for dates less than a given date.

But, when I run, for example, this code:
Set RS = DB.OpenRecordset("select id,field1,cdate(iif(isdate(field1),cdate(field1),#1/17/55#)) as dDate from accesslog order by id", dbOpenDynaset)
rs.FindNext !dDate > #1/17/1955#

I get rs.nomatch=true.
Same holds for rs.findfirst. It does seem to be able to find !ddate=#1/17/1955#.

How do I get it to find the other dates? I am thinking it's not recognizing them as dates. I've also tried rs.findnext cdate(rs!ddate)>#1/17/55#, no difference.
 
Oh heck, never mind. I've been working in SQL server for too long, and now am losing my mind. Wrong syntax for findnext!
 
Dates are stored as numbers so it's always possible that the difference between two numbers is too small for a given date format to display. In this example the two numbers are not equal but the date and times displayed are.
(This is copied from the immediate window)
Code:
? cdate(39814.55556)
1/01/09 1:20:00 PM 
? cdate(39814.55555)
1/01/09 1:20:00 PM
This is a thing to learn about working with dates.
 

Users who are viewing this thread

Back
Top Bottom