[erlang-questions] Comparing tuple records in MatchSpec

Maruthavanan Subbarayan maruthavanan_s@REDACTED
Fri Apr 26 21:58:27 CEST 2013

i have mnesia table which stores date in tuple format {Y,M,D}, 
To fetch data that falls on given date frames I tried to use this record
MatchSpec = [{#appointment{id='$1', starttime = '$2', endtime = '$3',  _='_'},                        [{'orelse',{'>=','$2',StartTime},{'orelse',{'=<','$3',EndTime}}}],                        ['*']}] 
where Startime and Endtime are records. This throws and bad arg during transaction.
But when I change the Startime and End time as integer or list it executes without any problem.
Is this the normal behaviour, or am I missing out anything, Any work around to achieve this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130426/c32cc5b1/attachment.htm>

More information about the erlang-questions mailing list