1 2 Previous Next 27 Replies Latest reply on Dec 15, 2008 6:23 PM by adcoleman

    Date field for a bibliography

    adcoleman

      Title

      Date field for a bibliography

      Post

      My previous query re mm/dd/yyy fields resulted from my work on a bibliography db.

       

      Here's the larger problem I have: A bibliography can include three varieties of date for periodicals -- 

       

      month, day, year (for daily or weekly or bi-weekly publications);

      month, year (for monthly or bi-monthly or quarterly periodicals);

      year only (for annuals and books).

       

      Thus I need to have the ability to enter dates with either the day not indicated or the day and month not indicated. And I need the results to show, variously, as month, day year; month, year; and year only. This eliminates the standard date field as either an entry method or a repository for results, as I understand it. That's why I went to text fields for the complete date and for the separate components. Thanks to TSGal's help, I now have the same data in all these fields.

       

      If I'm correct in assuming that I can't use a standard date field to show results that have no day date and no month entered, then what I need now is a way to go from my three separate date components -- month, day, and year -- to one consolidated result (mm/dd/yyyy).

       

      In the records I have created so far, I have entered 12/00/2008 for a monthly magazine published in December 2008; 00/00/2008 for an entry (such as a book) published in 2008; and 12/05/2008 for a newspaper article published on December 5, 2008. But of course I don't want the 00/ to show up in the final Date field; I want that to read 5 Dec. 2008, or Dec. 2008, or just 2008, depending on the publication type.

       

      I want all my existing records to have the Date field read that way. If I change the data in the date entry fields (the separate mm, dd, and yyyy fields), I want the Date field tto reflect the revision. And of course if I create a new record, I want the Date field to use that format for date info that I input into the date entry fields.

       

      I assume there's a calculation that will convert what's now entered in the separate mm, dd, and yyyy fields to a text date in the Date field, or can convert the current data in the Date field to the format indicated. And I assume that calculation, or another, could do that with all such data entered from now on.

       

      Hope this is clear enough to enable an answer. Let me know if you need more specifics.

        • 1. Re: Date field for a bibliography
          raybaudi
            

          IMAO you need 3 fields:

           

          date ( a real date field )

          type ( a text field with an attached value list of: daily, monthly, annuals )

          result ( a calculated text field that gives you what you need to display )

           

          A possible calculation for the "result" field is:

           

          Case(
          type = "daily" ; Day ( date ) & " " & Left ( MonthName ( data ) ; 3 ) & ". " & Year ( date ) ;
          type = "monthly" ; Left ( MonthName ( data ) ; 3 ) & ". " & Year ( date ) ;
          type = "annuals" ; Year ( date )
          )

          • 2. Re: Date field for a bibliography
            adcoleman
              

            Nothing A about your O, Daniele, at least not IMHO . . .

             

            Your proposed approach to the conversion process raises a question, perhaps just due to my inexperience. As I understand it, a date field won't allow an 00 entry, or a blank, for the day or month. Is that right? If so, I'd have to put in an arbitrary day and month in a date field -- let's say, for a book published in 2008, 01/01/2008. Selecting Annual or Book as my Type for this entry would then call up the calculation that would eliminate the 01/01 in a calculated text field, right?

             

            But then I, and anyone else who uses this solution, has to remember to key in a full acceptable datefield-type date with a false/arbitrary month and day in such cases. That doesn't feel right to me, and I think it will create problems with eventual sorts.

             

            So I'd prefer to keep my date-entry method in the three separate text fields, as presently organized.

             

            However, it should be possible to create a Type field, per your suggestion, and adapt your proposed calculation for the desired result in a textfield for Date. I will give it a try as soon as I manage to transfer the data from my current Date field to the Month Day Year fields.

             

            Working that way, what would I need to do to get the Month names (e.g, Dec., Jan.) to appear in place of the month numbers? 

            • 3. Re: Date field for a bibliography
              raybaudi
                

              "I'd have to put in an arbitrary day and month in a date field"

               

              Isn't 00/01/2008 an arbitrary ( but wrong ) month ?

               

              I'm still on my HO !

               

              You NEED a real date field.

               

              That can even be auto-entered, based on the choose of the type field.

               

              For example with:

               

              Case(
              type = "daily" ; Get ( CurrentDate ) ;
              type = "monthly" ; Date ( Month ( Get ( CurrentDate ) ) ; 1 ; Year ( Get ( CurrentDate ) ) ;
              type = "annuals" ; Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) )
              )

               

              so no one has to remember anything, there will not be any problem with eventual sorts and the MonthName ( ) function will work.


              • 4. Re: Date field for a bibliography
                adcoleman
                  

                In your first post to this query you started by writing "IMAO you need 3 fields:" No need to be so H -- there's a middle ground between H and A . . .

                 

                Anyhow, the problem as I see it with a date field is that I have to enter a false day date for a monthly publication and a false day and month date for an annual publication.

                 

                If I then want to do a chronological sort, and I have entered (for a 2008 book) 1, 1, 2008, it will show up at the beginning of the year. And if I have entered (for a monthly periodical) 2, 1, 2008, it will show up at the beginning of February in the sort.

                 

                I don't know that this is a bad thing, but I don't know that it's a good thing.

                 

                Also, my entries won't make much use of the current date. They come from all over the place, and from many different dates stretching over decades.

                 

                So why shouldn't I use a textfield filled via a calculation to the effect that if Month is larger than 00 then include month, if Day is larger than 00 include day, always include Year?

                 

                In short, what advantage do I gain from using a datefield for this?

                 

                Allan 

                • 5. Re: Date field for a bibliography
                  raybaudi
                    

                  Hi Allan

                   

                  "Anyhow, the problem as I see it with a date field is that I have to enter a false day date for a monthly publication and a false day and month date for an annual publication."

                   

                  You already are doing so; IOW you already enter a false date like 00/00/2008 ... why not enter a real date like 01/01/2008 ?

                   

                  "If I then want to do a chronological sort, and I have entered (for a 2008 book) 1, 1, 2008, it will show up at the beginning of the year. And if I have entered (for a monthly periodical) 2, 1, 2008, it will show up at the beginning of February in the sort."

                   

                  The sort order will be better...

                   

                  Try to sort:

                   

                  00/00/2008
                  12/00/2008
                  01/00/2008
                  00/00/2007
                  12/00/2007
                  ( in a text field )

                   

                  AND

                   

                  01/01/2008
                  12/01/2008
                  01/01/2008
                  01/01/2007
                  12/01/2007
                  ( in a date field )

                   

                  "Also, my entries won't make much use of the current date."

                   

                  The calc that I had given you is only an example and it was an auto-enter calc for a date field, not for a calculation ( result date ) field; so you can always modify the date field.

                   

                  "In short, what advantage do I gain from using a datefield for this?"

                   

                  I can see the advantages ( for example the MonthName calc or give a try to enter this in a date field: 1/1/8 ) but, if you don't see nothing better than your approach, I strongly wish you go on on your way.





                  • 6. Re: Date field for a bibliography
                    adcoleman
                      

                    Daniele --

                     

                    Don't get me wrong. I'm not a total newbie, but I'm not at developer level. I'm genuinely looking to be educated, and am open to persuasion convincing me that a datefield will work better than a textfield, or that one approach to this problem is better than another.

                     

                    Leaving a field blank (or using 00 as the equivalent) seems to me to leave me more options. For example, I could then organize a sort to put the 00 entries at the beginning of each month (or each year, in the case of books) or at the end of the year. Whereas assigning them an 01/01/2008 date means they'll all show up as 1 Jan. 2008 listings --all books published in 2008, and all magazines published in Jan. 2008 -- mixed in with any actual 01/01/2008 listings.

                     

                    Perhaps creating the Type field you suggest would take care of that, by enabling me to distinguish between Daily, Monthly, and Annual entries.

                     

                    In any case, don't assume that I understand why a datefield would work better than a textfield, or what advantages a datefield offers in general. I appreciate your input, and your help in thinking this through.

                    • 7. Re: Date field for a bibliography
                      raybaudi
                        

                      "Perhaps creating the Type field you suggest would take care of that, by enabling me to distinguish between Daily, Monthly, and Annual entries."

                       

                      Not perhaps, sure.

                       

                      You can sort by type and date or you can even find only annual and sort by date.

                      • 8. Re: Date field for a bibliography
                        adcoleman
                          

                        Okay -- can you tell me, Daniele, what advantages I'll get from a datefield that I wouldn't get from a textfield?

                         

                        Allan 

                        • 9. Re: Date field for a bibliography
                          raybaudi
                            

                          Aren't these enough ?

                           

                          1) More friendly enter data into the field ( like 1/1/8 and not 00/00/2008 )

                           

                          2) Sorting by date

                           

                          3) Calculations on a date field ( like get the day, the dayname ecc. )

                           

                          4) Multipredicate relationship with < and > simbols ( to filter records on a portal )

                          • 10. Re: Date field for a bibliography
                            adcoleman
                              

                            OK, Daniele, I'm persuaded -- even though I don't (yet) have a clear idea of what you mean by your (4). I appreciate your assumption as to my level of db savvy.

                             

                            I'm going to proceed on the following assumption:

                             

                            1. I'll set up a Type field with the values Daily, Monthly and Annual. (Already done.)

                             

                            2. I will then associate all current records with one of those three values. (I know how to do the necessary sorts and Replace Field Content tasks.)

                             

                            3. I'll then convert all dates in the current Date textfield from 00/ and 00/00/ to 01/ and 01/01/.(I know how to do the necessary sorts and Replace Field Content tasks.)

                             

                            4. I'll then convert that Date textfield to a datefield, since it should then be able to read all the dates already entered. That will become my date entry field for new records, as I understand it.

                             

                            5. I'll create a new field governed by a calculation that will consider both the Date field and the Type field and give me a result that looks like 1 Jan. 2009 (for a periodical/daily), Jan. 2009 (for a magazine/monthly), or simply 2008 (for an annual/book).

                             

                            Am I right about all that? If so, I'll get started. I'll need help with (5), since I've never done that before.

                             

                            Allan 

                            • 11. Re: Date field for a bibliography
                              raybaudi
                                

                              "I'll need help with (5), since I've never done that before."

                               

                              You can find the calculation in my first post.

                              • 12. Re: Date field for a bibliography
                                adcoleman
                                  

                                Quick question, Daniele --

                                 

                                Once I have converted all the dates presently in the Date textfield to actual dates -- no more 00/ or 00/00/, everything 01/01/XXXX or otherwise recognizable dates -- can I then convert that textfield to a datefield with no problems, and with it retaining the data as presently entered?

                                 

                                And is there anything you recommend that I do in setting up the datefield itself?

                                 

                                Allan 

                                • 13. Re: Date field for a bibliography
                                  raybaudi
                                    

                                  "Once I have converted all the dates presently in the Date textfield to actual dates -- no more 00/ or 00/00/, everything 01/01/XXXX or otherwise recognizable dates -- can I then convert that textfield to a datefield with no problems, and with it retaining the data as presently entered?"

                                   

                                  Yes, there will be no problem to change the field definition from text to date.

                                   

                                  "And is there anything you recommend that I do in setting up the datefield itself?"

                                   

                                  Nothing of particular but, if you want, you can format the date as a Drop-Down Calendar.

                                  • 14. Re: Date field for a bibliography
                                    adcoleman
                                      

                                    A drop-down calendar won't be advantageous, since the dates of my entries range over a roughly 50-year period.

                                     

                                    Here's where I am: I've conformed all the dates in the Date field to actual dates, and I've converted that to a datefield. I see that now I can enter a day or month as either 3 or 03. I set this up so that it automatically converted all existing 01 days and months to just 1, etc.

                                     

                                    Also: I've created the result field for the calculation you provided. Should this be a textfield or a calculation field? And, again, aside from reiterating your calculation, anything I need to do in setting up this field -- validation, etc.?

                                    1 2 Previous Next