Crystal Date Question

Amazing thank you!



~Charlie

_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Brian W. Spolarich
Sent: Wednesday, April 01, 2009 3:25 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Crystal Date Question



How about this? This literally returns a DateTime value for the first day of
the month and year twelve months ago from the current date.

DateTime(Year(DateAdd("m",-12,CurrentDate)),Month(DateAdd("m",-12,CurrentDat
e)),1)

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix
bspolarich@advanced <mailto:bspolarich%40advancedphotonix.com>
photonix.com ~ 734-864-5618 ~ www.advancedphotonix.com

-----Original Message-----
From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com] On
Behalf Of Charlie Wilson
Sent: Wednesday, April 01, 2009 3:18 PM
To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
Subject: [Vantage] Crystal Date Question

All,

I need to figure out what the date was for the first day of the month for
what ever month it was 12 months ago.

So if todays date was 4/6/2009 then I need equation to spit out the date
4/1/2008. The best thing I could come up with was:

date(Left (CStr (Month (CurrentDate - 365)), (Length (CStr (Month
(CurrentDate - 365))) - 3)) & "/1/" & Left(Replace (CStr(Year (CurrentDate -
365)),",",""), (Length (Replace (CStr(Year (CurrentDate - 365)),",","")) -3)
))

Which is a horrible way to do it.

Any ideas?

~Charlie

[Non-text portions of this message have been removed]

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have
already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and
Crystal Reports and other 'goodies', please goto: http://groups.
<http://groups.yahoo.com/group/vantage/files/>
yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.
<http://groups.yahoo.com/group/vantage/messages>
yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups. <http://groups.yahoo.com/group/vantage/linksYahoo>
yahoo.com/group/vantage/linksYahoo! Groups Links





[Non-text portions of this message have been removed]
All,



I need to figure out what the date was for the first day of the month for
what ever month it was 12 months ago.



So if todays date was 4/6/2009 then I need equation to spit out the date
4/1/2008. The best thing I could come up with was:



date(Left (CStr (Month (CurrentDate - 365)), (Length (CStr (Month
(CurrentDate - 365))) - 3)) & "/1/" & Left(Replace (CStr(Year (CurrentDate -
365)),",",""), (Length (Replace (CStr(Year (CurrentDate - 365)),",","")) -3)
))



Which is a horrible way to do it.



Any ideas?





~Charlie





[Non-text portions of this message have been removed]
How about this? This literally returns a DateTime value for the first day of the month and year twelve months ago from the current date.

DateTime(Year(DateAdd("m",-12,CurrentDate)),Month(DateAdd("m",-12,CurrentDate)),1)

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Charlie Wilson
Sent: Wednesday, April 01, 2009 3:18 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Crystal Date Question

All,



I need to figure out what the date was for the first day of the month for
what ever month it was 12 months ago.



So if todays date was 4/6/2009 then I need equation to spit out the date
4/1/2008. The best thing I could come up with was:



date(Left (CStr (Month (CurrentDate - 365)), (Length (CStr (Month
(CurrentDate - 365))) - 3)) & "/1/" & Left(Replace (CStr(Year (CurrentDate -
365)),",",""), (Length (Replace (CStr(Year (CurrentDate - 365)),",","")) -3)
))



Which is a horrible way to do it.



Any ideas?





~Charlie





[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links