Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Compare system date to field date



******    message to minivend-users from "Ed LaFrance" <edl@newmediaems.com>     ******

If you have verified that [item-data events EventID] is actually returing 
the value that you expect, this should work:

[if type=data term="events::SortDate::[item-data events EventID]" op=">=" 
compare="20000722"]
   The event occurs on or after July 22nd, 2000
[/if]

Then you SHOULD be able to capture the current date in a scratch variable:

[seti today][tag time]%Y%m%d[/tag][/seti]

..and use it in the test:

[if type=data term="events::SortDate::[item-data events EventID]" op=">=" 
compare="[scratch today]"]
   The event occurs on or after [scratch today]
[else]
   The event has already passed as of [scratch today]
[/else]
[/if]

...you MIGHT also be able to put the [tag time][/tag] expression directly 
in the compare argument in the if.  All code is untested, please verify the 
syntax if it does not work.

- Ed L.

> ******    message to minivend-users from "Curt Hauge" 
<chc@mninter.net>     ******
> 
> Hi list,
> 
> And thanks for the help in the past. I have been trying to compare todays
> date with a date in a field in the current database. I use MV4.04 and I 
know
> I am real close. The date format in the DB 'events' for the 
field 'SortDate'
> is 20000722. Perhaps this cant be done the way I expect. Here is what I 
have
> tried, without success:
> 
> (substituted various operands in many cases: ==, =~, >=, gt, ge)
> 
> example 1
> [if data events::SortDate::[item-data events EventID] ge [tag
> time]%Y%m%e[/tag]]hello[/if]
> 
> Please note - this works:
> [if data events::SortDate::[item-data events EventID] ge 20000722]hello
> world[/if]
> 
> example 2
> [seti cur_date][tag time]%Y%m%e[/tag][/seti]
> [if data events::SortDate::[item-data events EventID] ge /[scratch
> cur_date]/i]hello world[/if]
> 
> note: [scratch cur_date] does produce 20000722
> 
> example 3
> [item-data events Start_Date]</b>[if data events::SortDate::[item-data
> events EventID] ge /[tag time]%Y%m%e[/tag]/i]hello world[/if]
> 
> example 4
> [if type=value term=[tag time]%Y%m%e[/tag] op="ge" compare="/[value
> SortDate]/"]hello world[/if]
> 
> this ALWAYS produces 'hello world' (and I dont know why)
> [if type=value term=20000722 op="ge" compare="/[value SortDate]/"]hello
> world[/if]
> 
> example 5
> [if type=value term="events::SortDate::[tag time]%Y%m%e[/tag]" op="ge"]
> hello world[/if]
> 
> example 6
> [if explicit]
> [condition]
> $cur_date = '[value SortDate]';
> return 1 if $cur_date ge [tag time]%Y%m%e[/tag];
> [/condition]
> hello world
> [/if]
> 
> Anyone?
> 
> Thank you,
> 
> Curt Hauge
> 
> 
> -
> To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to 
Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list
> 
> 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          edl@newmediaems.com
Placerville, CA  95667         http://www.newmediaems.com
(530) 622-9421                 (530) 622-9426 fax
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: