Click here to Skip to main content
15,891,431 members
Home / Discussions / Database
   

Database

 
GeneralRe: how to store an image Pin
prasadbuddhika30-Aug-07 2:26
prasadbuddhika30-Aug-07 2:26 
AnswerRe: how to store an image Pin
shivvish30-Aug-07 21:23
shivvish30-Aug-07 21:23 
QuestionHow to calculate no of sundays between two dates in sql Pin
ahmedalisha30-Aug-07 0:07
ahmedalisha30-Aug-07 0:07 
AnswerRe: How to calculate no of sundays between two dates in sql Pin
gauthee30-Aug-07 0:41
gauthee30-Aug-07 0:41 
AnswerRe: How to calculate no of sundays between two dates in sql [modified] Pin
John-ph30-Aug-07 1:37
John-ph30-Aug-07 1:37 
GeneralRe: How to calculate no of sundays between two dates in sql Pin
shivvish30-Aug-07 21:18
shivvish30-Aug-07 21:18 
AnswerRe: How to calculate no of sundays between two dates in sql Pin
shivvish30-Aug-07 21:16
shivvish30-Aug-07 21:16 
AnswerRe: How to calculate no of sundays between two dates in sql Pin
DQNOK31-Aug-07 4:00
professionalDQNOK31-Aug-07 4:00 
I answered this same question back in April. For a psuedo-code solution, check out http://www.codeproject.com/script/comments/forums.asp?msg=1993362&forumid=1725&mode=all&userid=3403440#xx1993362xx[^]


For a SQL solution, see http://www.codeproject.com/script/comments/forums.asp?forumid=1725&mode=all&userid=3403440&select=1993823&df=100&mpp=50&fr=4038#xx1993823xx[^]


Here is some of my personal code I use within Access. I have tested it, and use it within my projects.
CREATE PROCEDURE numCertainDays(date1 DATE, date2 DATE, wkdy INTEGER) AS
   SELECT CINT(@date2 - @date1) \ 7
      + IIF( WEEKDAY(@date2) < WEEKDAY(@date1), 1, 
             IIF( WEEKDAY(@date2) = @wkdy OR WEEKDAY(@date1) = @wkdy, 1, 0 ))
;

To get the number of Sundays, you would call it with wkdy=1.

David
Questionhow to use max function Pin
prasadbuddhika29-Aug-07 23:59
prasadbuddhika29-Aug-07 23:59 
AnswerRe: how to use max function Pin
Pete O'Hanlon30-Aug-07 0:03
mvePete O'Hanlon30-Aug-07 0:03 
GeneralRe: how to use max function Pin
prasadbuddhika30-Aug-07 0:13
prasadbuddhika30-Aug-07 0:13 
GeneralRe: how to use max function Pin
Pete O'Hanlon30-Aug-07 1:02
mvePete O'Hanlon30-Aug-07 1:02 
GeneralRe: how to use max function Pin
prasadbuddhika30-Aug-07 2:24
prasadbuddhika30-Aug-07 2:24 
GeneralRe: how to use max function Pin
Vimalsoft(Pty) Ltd30-Aug-07 19:40
professionalVimalsoft(Pty) Ltd30-Aug-07 19:40 
AnswerRe: how to use max function Pin
Vimalsoft(Pty) Ltd30-Aug-07 1:14
professionalVimalsoft(Pty) Ltd30-Aug-07 1:14 
GeneralRe: how to use max function Pin
prasadbuddhika30-Aug-07 2:25
prasadbuddhika30-Aug-07 2:25 
GeneralRe: how to use max function Pin
Urs Enzler30-Aug-07 7:22
Urs Enzler30-Aug-07 7:22 
GeneralRe: how to use max function Pin
Vimalsoft(Pty) Ltd30-Aug-07 19:47
professionalVimalsoft(Pty) Ltd30-Aug-07 19:47 
QuestionHow to create a new record, as part of a batch run, in MSAccess Pin
jonathanm529-Aug-07 22:08
jonathanm529-Aug-07 22:08 
AnswerRe: How to create a new record, as part of a batch run, in MSAccess Pin
Pete O'Hanlon29-Aug-07 23:05
mvePete O'Hanlon29-Aug-07 23:05 
QuestionVariable database name when executing stored procedure Pin
John Gathogo29-Aug-07 22:00
John Gathogo29-Aug-07 22:00 
AnswerRe: Variable database name when executing stored procedure Pin
DLM@TD14-Sep-07 11:31
DLM@TD14-Sep-07 11:31 
QuestionDIFFERENCE Pin
aprasy29-Aug-07 9:30
aprasy29-Aug-07 9:30 
AnswerRe: DIFFERENCE Pin
Pete O'Hanlon29-Aug-07 9:52
mvePete O'Hanlon29-Aug-07 9:52 
QuestionSQL Query for Excel file Pin
Swisher2429-Aug-07 6:55
Swisher2429-Aug-07 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.