Click here to Skip to main content
15,888,610 members
Home / Discussions / Database
   

Database

 
AnswerRe: importing data from access table in a sql server table Pin
Giorgi Dalakishvili25-May-09 23:57
mentorGiorgi Dalakishvili25-May-09 23:57 
Questioninsert into multiple server table in one transaction Pin
Abdul Rahman Hamidy25-May-09 17:52
Abdul Rahman Hamidy25-May-09 17:52 
AnswerRe: insert into multiple server table in one transaction Pin
ScottM126-May-09 3:11
ScottM126-May-09 3:11 
GeneralRe: insert into multiple server table in one transaction Pin
Abdul Rahman Hamidy26-May-09 19:57
Abdul Rahman Hamidy26-May-09 19:57 
AnswerRe: insert into multiple server table in one transaction Pin
Eddy Vluggen26-May-09 20:47
professionalEddy Vluggen26-May-09 20:47 
Questionhow to connect from Ms.Access to Sql server ? Pin
xingselex25-May-09 4:45
xingselex25-May-09 4:45 
AnswerRe: how to connect from Ms.Access to Sql server ? Pin
Eddy Vluggen25-May-09 6:41
professionalEddy Vluggen25-May-09 6:41 
QuestionAssigning values in an array... Pin
new_phoenix25-May-09 3:55
new_phoenix25-May-09 3:55 
I need some assistance with a small application. I need to loop through an existing array and to assign a value to it in a pattern. I thought that I could do it, but I am really at a loss as to how to proceed. I tried a wide variety of approaches but it does not yield the correct results.

As a smaller scale version of the array. Let us say that the array consists of 392 elements. The first element of the array consists of date values from 12/30/2007 and it proceeds up until 1/24/2009. The second element should be number values from 1 to 13.

The pattern is that there should be 28 values with the value 1, and then 28 values with the value 2, and then 28 values with the value of 3. This procedure continues with 28 values of the value 13. After the 28th value of 13, the numbering system should start over again with 28 values with the value of 1. This should populate all of the elements of the 392 element array.

The code below that I have written, for some reason, does not include the 28th value for each of these assignments. Also, it includes a 14th value following the last 13 value assignment. Please provide me with some assistance! Confused | :confused: Confused | :confused: Confused | :confused:

Public Function ZodiacPeriod(dteInputDate)
    Dim dteStart As Date
    Dim dteEnd As Date
    Dim intDateCount As Integer
    Dim intRow As Integer
    Dim intX As Integer
    Dim intCounter As Integer
    Dim arrArray(392, 1)
   
    intX = 1
    dteStart = #12/30/2007#
    dteEnd = #1/24/2009#
    intDateCount = DateDiff("d", dteStart, dteEnd)
    
    'Loading the array with dates
    For intRow = 1 To intDateCount
        arrArray(intRow, intColumn) = dteStart
        dteStart = dteStart + 1
    Next

    'The second element value is assigned here
    For intRow = 0 To 392
        If intCounter <= 27 Then
            If intX >= 14 Then
                intX = 1
            End If
            intCounter = intCounter + 1
        Else
            intCounter = 1
            If intX < 14 Then
                intX = intX + 1
            End If
        End If
        arrArray(intRow, 1) = intX
    Next intRow

    'Now to go through the array and return the value in the array
    For intRow = 0 To 392
        If arrArray(intRow, 0) = dteInputDate Then
            ZodiacPeriod = arrArray(intRow, 1)
            Exit For
        End If
    Next intRow
End Function


I have encountered problems in which a value of 14 is assigned. I have encountered problems in which the requirements are not matched. Any assistance would be appreciated.
AnswerRe: Assigning values in an array... Pin
riced25-May-09 7:03
riced25-May-09 7:03 
QuestionArticle Status Pin
specialdreamsin25-May-09 2:27
specialdreamsin25-May-09 2:27 
AnswerRe: Article Status Pin
Henry Minute25-May-09 4:23
Henry Minute25-May-09 4:23 
QuestionFolder Permissions Pin
jonhbt25-May-09 1:25
jonhbt25-May-09 1:25 
AnswerRe: Folder Permissions [modified] Pin
Eddy Vluggen25-May-09 7:03
professionalEddy Vluggen25-May-09 7:03 
QuestionRe: Folder Permissions Pin
jonhbt25-May-09 19:30
jonhbt25-May-09 19:30 
AnswerRe: Folder Permissions Pin
Eddy Vluggen26-May-09 0:28
professionalEddy Vluggen26-May-09 0:28 
QuestionRe: Folder Permissions Pin
jonhbt26-May-09 1:46
jonhbt26-May-09 1:46 
AnswerRe: Folder Permissions Pin
Eddy Vluggen26-May-09 6:15
professionalEddy Vluggen26-May-09 6:15 
GeneralRe: Folder Permissions Pin
jonhbt26-May-09 19:54
jonhbt26-May-09 19:54 
GeneralRe: Folder Permissions Pin
Eddy Vluggen26-May-09 20:42
professionalEddy Vluggen26-May-09 20:42 
GeneralRe: Folder Permissions Pin
jonhbt26-May-09 20:50
jonhbt26-May-09 20:50 
Questionstring comparision Pin
Hemant Thaker24-May-09 22:54
Hemant Thaker24-May-09 22:54 
AnswerRe: string comparision Pin
Luc Pattyn25-May-09 0:20
sitebuilderLuc Pattyn25-May-09 0:20 
Questionhow to get shell&gt; in mysql from mysql&gt; prompt in windows Pin
ranjithgoud24-May-09 18:50
ranjithgoud24-May-09 18:50 
QuestionHiring home based workers (2482) Pin
affan qazi23-May-09 22:34
affan qazi23-May-09 22:34 
AnswerSpam Pin
Eddy Vluggen23-May-09 22:40
professionalEddy Vluggen23-May-09 22:40 

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.