Please explain: How do you set the filed? Copy and Paste or Set Field?
DataViewer showing GetAsDay(date) as "?" indicates that "date" is NOT a date.
Remember that DataViewer variables as well as other variables are always text.
Start testing with with
GetAsNumber ( Get ( CurrentDate ) )
which returns something like 734851.
Check what numbers your other date values return.
Avoid Copy and Paste, use Set Field.
Once you have set your fields right, you can search like in numbers < ≤ = ≥ > date1..date2 .
If you want to search for specific months or days you need separate calculated field.
A Date, Time, or Timestamp can be treated exactly like a number. For many operations tis is the only reliable way.
I managed to establish that although they were not showing there were spaces after the year. By creating a GetAsText field = TheAwkwardDate field I was then able to replace the text field with Left(TextField;10) and then use that field to re-set the TheAwkwardDate field. I could not apply the Left function directly to the date it did not work.
The only way I realised there were spaces is that I went to edit TheAwkwardDate field and when I went to the end of the field although it showed the cursor immediately after the end of the year, it took an additional 3 backspaces to clear the last digit of the year.
I then tried exporting to excel where I could see the spaces when I tabbed to the end of TheAwkwardDate field.
Very odd and BTW it made no difference if I copied and pasted, set field or even imported the data I ended up with the same problem.
I know that the GetAsDay(date) as "?" indicates that "date" is NOT a date ? suggests it is not a date but the field was formatted as a date and it looked like a date so was frustrating to find these pesky hidden spaces.
I know that the GetAsDay(date) as "?" indicates that "date" is NOT a date
Not exactly. It indicates that the value is not a valid date. This can happen when data is imported into a date field. For example, importing m/d/y data into a file using d/m/y date format will render some of the values invalid.
The first thing you should do, IMHO, is find out which date format your converted file is using. Set the file to 'Always use file's saved settings' (under File > File Options > Text), format a date field to display data 'As entered', then insert the current date into the field.
You all are talking about a function that does not exist: GetAsDay( )
Yeah, well - the GetAseText() function does not exist either, but I think the intention is clear.
Oops and thanks as you say people knew what I meant to say
I am a long way from being an expert which is why I needed to post here and get help.
Thanks I have learned the hard way but at least I have learned :)