Useful code to identify weekend dates in a file

Posted on 2003-10-23
Last Modified: 2010-04-17
I want to find a block of code or some sort of plug-in to assist me with pulling out all records that contain a weekend date in the dateField column.
Question by:peacockcl
  • 3

Expert Comment

ID: 9609360
what's the db vendor? access/sql server? or are you doing this programmatically. .. if so, then what's langauge?

Author Comment

ID: 9609393
I'm using ACL, much like access/sql server but not quite as powerful or easy to use.  I was wondering if there was anything out there that I could adapt to work with my program.

Accepted Solution

malharone earned 125 total points
ID: 9609455
in ms sql server, use DATENAME(dw,YOUR_DATE_FIELD) e.g. SELECT DATENAME(dr, getdate())  
  -- this function in your sql statement returns the day of the week (Sunday, Monday, and so on). so you can set a where condition to exclude/include rows.

in msaccess
SELECT Table1.dt
FROM Table1
WHERE (((Format([dt],"dddd"))="sunday")) OR (((Format([dt],"dddd"))="saturday"));

Expert Comment

ID: 9609648
i'm not familiar with ACL. if it is db system, then i'm sure they provide date/time calculation functionality.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now