Re: Search a date field by month only...

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24351
interpreted = N
texte = >I want to be able to search a date field by either the month or year. Do I >have to have independent fields for month & year?Normall it's best to use separate fields for month and year, but if you would be satisfied to retrieve all records while displaying only the ones for certain months and years, you can put a couple of [showif] contexts inside your founditems context like this:[founditems] [showif [getchars start=7&end=10][eventdate][/getchars]=1999] [showif [getchars start=1&end=2][eventdate][/getchars]=11] fields to display here [/showif] [/showif] [/founditems]If your search context retrieves all records in the db, this example will display only those records in the month of November 1999, assuming your dates are stored in the default mm/dd/yyyy format. If your dates are stored in another format, simply adjust the start and end values in the getchars contexts appropriately ... :)================================ Kenneth Grome, WebDNA Consultant 808-737-6499, http://webdna.net ================================ ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: Search a date field by month only... (Vince Medina 1999)
  2. Re: Search a date field by month only... (Kenneth Grome 1999)
>I want to be able to search a date field by either the month or year. Do I >have to have independent fields for month & year?Normall it's best to use separate fields for month and year, but if you would be satisfied to retrieve all records while displaying only the ones for certain months and years, you can put a couple of [showif] contexts inside your founditems context like this:[founditems] [showif [getchars start=7&end=10][eventdate][/getchars]=1999] [showif [getchars start=1&end=2][eventdate][/getchars]=11] fields to display here [/showif] [/showif] [/founditems]If your search context retrieves all records in the db, this example will display only those records in the month of November 1999, assuming your dates are stored in the default mm/dd/yyyy format. If your dates are stored in another format, simply adjust the start and end values in the getchars contexts appropriately ... :)================================ Kenneth Grome, WebDNA Consultant 808-737-6499, http://webdna.net ================================ ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Server IP address? (1998) [shownext max=?] armed (1997) wild question (1998) WebMerchant and MacAuthorize Errors (1998) form data submission gets truncated (1997) [shownext max=?] armed (1997) OFF-TOPIC: Check www.godaddy.com for me ... (2003) RE: Purchased cart being overwritten (1997) [WebDNA] Browser types (2010) Thanks and Big News!!! (1997) How to pass from a detail page to anothere to another? (1998) WebCat2.0 acgi vs plugin (1997) Summing fields (1997) List of WebDNA users (2002) OT: passing variables to .asp (2000) webcat 3.06f on Linux keeps dying (1999) WebCatalog2 Feature Feedback (1996) Email Destination Folder Question (2004) WebCat2b12 CGI Mac - [shownext] problem (1997) Sum of [founditems] ? (2004)