[erlang-questions] Comparing tuple records in MatchSpec

Yogish Baliga yogishb@REDACTED
Sat Apr 27 00:35:59 CEST 2013


Why not store unix time stamp instead?



On Apr 26, 2013, at 12:58, Maruthavanan Subbarayan <maruthavanan_s@REDACTED> 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
> erlang-questions@REDACTED
> 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.htm>


More information about the erlang-questions mailing list