Solved

Useful code to identify weekend dates in a file

Posted on 2003-10-23
7
232 Views
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.
0
Comment
Question by:peacockcl
  • 3
7 Comments
 
LVL 9

Expert Comment

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

Author Comment

by:peacockcl
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.
0
 
LVL 9

Accepted Solution

by:
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"));
0
 
LVL 9

Expert Comment

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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

816 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

12 Experts available now in Live!

Get 1:1 Help Now