navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Is this possible...

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Is this possible...
Page: [1]
 
Bnugent

 

Posts: 257
From: Tampa Florida Tampa, FL USA
Status: offline

 
Is this possible... - 1/11/2008 16:21:17   
Here is my query which is pretty straight forward:

SELECT convert(numeric(19,0),SUM(SUBTOTAL)) AS TOTAL FROM SOP30200 WHERE Year(DOCDATE) = 2008 And Month(DOCDATE) = 1 AND SOPTYPE=3 AND CUSTNMBR LIKE 'alston'

Pulling directly from SQL d'base using DRW on spooky diet...

How would I run that similar query, but have it format results based on where we woudl end up for the month (i.e., forecast)...

Exmaple, today is the 11, their are 31 days in January, there fore we are 35% done with the month...

so my original query above shows me that sales so far this month are for example, $1000...that would mean we are on pace for sales of approx 1538.5 (1000 divided by .65 remaining days of year).

Does this make sense? I want to calculate in my query, current date (11) divide by the total number of days in the current month) and divide that from my SUBTOTAL above?

Is this doable? If so how?


_____________________________

Brian---
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Is this possible... - 1/16/2008 13:32:34   
Personally, I would do it in asp as its what I know best :)
You should be able to perform some math on the output of each month


eg - number of days in the month (using existing date)

<%
Function GetDaysInMonth(dtmDate)
If IsDate(dtmDate) Then
dtmFirstOfMonth = DateSerial(Year(dtmDate),Month(dtmDate),1)
GetDaysInMonth = Day(DateAdd("d",-1,DateAdd("m",1,dtmFirstOfMonth)))
End If
End Function

response.write GetDaysInMonth("12/12/2007") 

%> 


Now you have the number of days, you could subtract todays date from the days in the month etc.



_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Bnugent)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Is this possible...
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts