[erlang-questions] Comparing tuple records in MatchSpec

Yogish Baliga <>
Sat Apr 27 00:35:59 CEST 2013


Why not store unix time stamp instead?



On Apr 26, 2013, at 12:58, Maruthavanan Subbarayan <> wrote:

> Hi,
> 
> 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?
> 
> Thanks,
> Marutha
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130426/7340537f/attachment.html>


More information about the erlang-questions mailing list