pkudrle Posted July 1, 2003 Posted July 1, 2003 I have a script that performs a find via a date field. The field searches for all records with a date greater than today. How do I include titles without a date in that search. I also want to make sure that the fields with "null" are added to the end of the records list. Do I need to add some type of value to the field? Paul
kenneth2k1 Posted July 1, 2003 Posted July 1, 2003 Hi: To include records with no date, you can append this to the end of your search script: New record/request Set Field [DateField, "=" Perform Find [] Then, to list with all the empty values at the bottom, you will need to add a sort to your script. Go to your list and sort by your date field. Get the order you want and go back to your find script and put this step: Sort [Restore] Or make a separate script for sorting by this date field and add it as a sub-script. Ken P.S. Sorting your date field in descending order will put the emtpy ones at the bottom.
Leb i Sol Posted July 3, 2003 Posted July 3, 2003 or creating another calc field (check_date) that is 1 or 0 depending if the date is empty or not. --------------------------------------------------------------Ugo-- Check_Date Calcualtion Unstored,=Case(not IsEmpty('Date_field'),1,0) ---------------------------------------------------------------- then sort descending or asc. [Check_Date] [date_field] ========================= 1-has a date 1-has a date 1.. 1.... 1.. 0- no date 0- no date 0- no date all the best!
Ugo DI LUCA Posted July 3, 2003 Posted July 3, 2003 Zilla! Good... One little adjustment. Check_Date Calcualtion Unstored,=Case(DateFied>Status(CurrentDate),1,0)
Leb i Sol Posted July 3, 2003 Posted July 3, 2003 Ugo: sometimes I can't read - that the user wanted ">" - but hey I am learning slowly but surely
-Queue- Posted July 4, 2003 Posted July 4, 2003 Another little adjustment: Check_Date Calcualtion Unstored,= DateField > Status(CurrentDate) The Case isn't necessary since the conditional itself is boolean. So, if DateField is greater than today's date, it will give a 1; otherwise it will produce a zero.
pkudrle Posted July 8, 2003 Author Posted July 8, 2003 Slight problem has occurred. This works great, but I get a zero value in all the dates that are not "> today". How do I get the older dates with the same "1" value. thanks for all the help Paul
Ugo DI LUCA Posted July 8, 2003 Posted July 8, 2003 pkudrle said: I get a zero value in all the dates that are not "> today". How do I get the older dates with the same "1" value. I don't get it. If the older dates also have a 1, then this tip calulation is useless. You said you wanted to list the dates that are not "> today"...
pkudrle Posted July 8, 2003 Author Posted July 8, 2003 Ok so I may have figured out my own solution, thanks in part to your previous suggestions. This is my solution: If(IsEmpty(WideRelease), 0, 1) Does anyone see any problems that could occur? I will then sort by that field, and then by date to get the "null" values at the bottom. thanks again, Paul
Leb i Sol Posted July 8, 2003 Posted July 8, 2003 relax guys I think that the orig. poster has enough to work with
pkudrle Posted July 8, 2003 Author Posted July 8, 2003 Ugo DI LUCA said: I don't get it. If the older dates also have a 1, then this tip calulation is useless. You said you wanted to list the dates that are not "> today"... Sorry for the confusion. I have older dates that I also need to show at times, but I still need the "null" values at the bottom. The "If" statement I have made seems to have solved it for me. Thanks again, Paul
Ugo DI LUCA Posted July 8, 2003 Posted July 8, 2003 OK, I get it... YES, this calc was designed just for that purpose. It's the sort key field you will use to drop the empties at the end, using either Case or If...
-Queue- Posted July 8, 2003 Posted July 8, 2003 pkudrle said: Ok so I may have figured out my own solution, thanks in part to your previous suggestions. This is my solution: If(IsEmpty(WideRelease), 0, 1) More simply, not IsEmpty(WideRelease). The If() isn't necessary, again, since the IsEmpty calculation is boolean. So not IsEmpty() returns a 1 if the field isn't empty and a zero if it is.
Recommended Posts
This topic is 7812 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now