I need help!! I have a @DBLookup that I can not get to cooperate and I don’t understand why. It seems like it should be pretty straight forward.
The scenario: I have a form with a date field called art_date_completed. I want to display a view that shows these records by the week ending date that the date field falls in to. I created documents with an agent, which contain a date and the week end date that the date falls in to. For example, 04/16/2008 falls in to the week end date of 04/19/2008.
In the previously mentioned form, I have a hidden computed field with the following dblookup:
@If(art_date_cmpl > “”;@DbLookup(“”:“NoCache” ; “”; “weekdys”; art_date_compl;end);“”)
so, when the art_date_completed field has a date entered, I do a @text conversion into another hidden field on the form called art_date_cmpl. The date in the documents I created with the agent are also in text form but the view always comes back as Non-Categorized. I do have the first column sorted.
I have read through countless postings here to see if I could find something that may help with my problem but so far, nothing. Any help would be greatly appreciated.
Thanks,
Tom
Subject: @DBLookup
2 things need to look at:
(1) is the field name art_date_cmpl or art_date_compl? note you have an extra “o” in the @DbLookup formula;
(2) check if you have put this field as the first sorted column in the view.
Good luck.
hut
Subject: RE: @DBLookup
Field is art_date_cmpl (I did have a “o” in there that should not have been). Still does not work. I do have the date as the first column in the view and it is sorted.
Thanks
Tom
Subject: RE: @DBLookup
The first column in the view need to be art_date_cmpl (text) instead of art_date_completed (date). If that’s the case, then when you enter a date in the art_date_completed field, does this date already exist in the view or it will be a new date? If it’s new, then the lookup cannot find a corresponding end date for it since there is no match.
HTH.
Subject: @DBLookup
Am I misunderstanding, are you doing the Look-up to determine the week end date?
Is the week end date not standard? (I.e. it’s not always the Friday of the week?)
If it’s is Standard, you could just calculate the week end date automatically without having to do a look-up.
For example if Friday is your End of Week day (and anything from Saturday to Friday should be set to Friday then)
adj := @Modulo(6 - @Weekday( art_date_completed );7);
art_date_cmpl := @Adjust( art_date_completed; 0;0;adj;0;0;0);
Subject: RE: @DBLookup
Stephen,
No. You understood what I was trying to do. I was just thinking that I could do it using a DBLookup. I change my approach to something similar to what you suggested and I was able to get that to work. I appreciate your help.
Tom