View Full Version : Comparing Current date with an 8-numeric digits field with Query
Guest.Visitor
02-04-2005, 12:22 PM
Try this... then just compare TODAY to WORKDATE. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b218e8a/0')
Guest.Visitor
02-11-2005, 02:09 AM
Thanks for your reply This helps if we do an equate-comparison. However i liked to set the systemdate in the form CCYYmmdd. Is this possible with query400 ?
Guest.Visitor
02-11-2005, 04:55 AM
I'm confused. You originally said you wanted to compare dates, now you're saying that you don't want to do an "equate-comparison". What are you really trying to do? And do you want the CCYYMMDD in character or decimal format? You can play around with DIGITS, SUBSTR, MICROSECONDS. Chris
Guest.Visitor
02-11-2005, 07:45 AM
This is ugly, but it may be what you are looking for ... <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b218e8a/3')
Guest.Visitor
02-11-2005, 08:33 AM
Thanks for your replies. I'm sorry but my first question is indeed confusing. What i want to do is building a query400. In the selection criteria i want to compare a 8-digit date of a database (ccyymmdd) with the systemdate. The comparison should be EQUAL or GREATER THAN the systemdate. So i'm looking for something like: DataBaseDate GE systemdate Example: DateBaseDate = 20050630 It seems to me that Zaed's reply is what i need. I'll try it next Monday. Thanks... and sorry for confusing you.
Guest.Visitor
02-11-2005, 09:33 AM
Hello, Can someone help me to compare in Query400 a databasefield of 8 digits (century-Year-Month-Day) with the systemdate (Current Date) ? Which calculations / instructions have i to specify? Any help is greatly appreciated.
Guest.Visitor
02-11-2005, 09:33 AM
Create fields as follows: SearchDate substr(digdate(MMDDYYYY),5,4) || '-' || substr(digdate(MMDDYYYY),1,2) || '-' || substr(digdate(MMDDYYYY),3,2) CurrentDat char(current(date),ISO) OldestDate char(date(current(date) - 7 days),ISO) NewestDate char(date(current(date) - 1 days),ISO) Under the select records you can now do statements like SearchDate RANGE OldestDate NewestDate SearchDate RANGE '2004-02-01' '2004-02-31' There are more tricks for this as well.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.