Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Generating Invoice between the Dates

Author  Topic 

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-02 : 18:17:58
Hello Friends
Here is a situation for me. I am working on one of the Invoicing Application. I need to generate the invoice based on the
MonthEnd and PriorMonthEnd Dates. For Example the Dates are 9/10/2006(Prior Month End) to 10/15/2006(Month End)
In this case i need to pick all the invoices between these dates. Here is a function that is in VB6. It's kinda hard to understand.
Can some one help me with this function. I am using VB.NET/ASP.NET and SqlServer2000.
Thx

Function ReturnBcastMonth(DateArg As Variant, RequiredVal As Integer)

Dim Function_Name As String
Dim Curr_Err As Integer
Dim Curr_Err_Msg As String
Dim RetryCount As Integer
Dim SQLString As String
Dim Status As Variant
Dim I As Integer
Dim NewDate As Variant
Dim RetVal As Variant

On Error GoTo Err_Handler
Function_Name = "ReturnBcastMonth"
Call glrEnterProcedure(Function_Name)

RetVal = "ERROR"

For I = 0 To (BcastMonthArray(1).ArraySize - 1)

Dim CheckDate As Date
Dim BMStart As Date
Dim BMEnd As Date

CheckDate = DateArg
BMStart = BcastMonthArray(I).BeginDate
BMEnd = BcastMonthArray(I).EndDate

If (CheckDate >= BMStart) Then

End If

If (CheckDate < BMEnd) Then

End If


If (CheckDate >= BMStart And CheckDate <= BMEnd) Then
'We have our month
Select Case RequiredVal
Case BC_BEGINDATE
RetVal = BcastMonthArray(I).BeginDate
Case BC_ENDDATE
RetVal = BcastMonthArray(I).EndDate
Case BC_MONTH
RetVal = BcastMonthArray(I).MonthName
Case BC_YEAR
RetVal = BcastMonthArray(I).BcastYear
Case BC_MONTH_YEAR
RetVal = BcastMonthArray(I).MonthName & " " & BcastMonthArray(I).BcastYear
End Select
Exit For
Else
'Keep searching
End If
Next I


Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-10-02 : 20:17:41
It would help if you could explain what your function is supposed to do.




CODO ERGO SUM
Go to Top of Page

vk18
Posting Yak Master

146 Posts

Posted - 2006-10-02 : 23:31:35
quote:
Originally posted by Michael Valentine Jones

It would help if you could explain what your function is supposed to do.




CODO ERGO SUM



Hi Mic,

I will use this function as i said for generating the invoice between the dates(For gettting the broadcastmonth record). here is the Example but it is in VB6.

BroadcastMonthEnd = ReturnBcastMonth(WF!broadcast_month, BC_ENDDATE)
PriorBroadcastMonthEnd = ReturnBcastMonth(WF!broadcast_month, BC_BEGINDATE)

Thx


Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-10-03 : 05:22:54
It would help if you could explain what your function is supposed to do.


CODO ERGO SUM
Go to Top of Page
   

- Advertisement -