Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get previous date 1

Status
Not open for further replies.

ram567

Programmer
Dec 28, 2007
123
US
Hi!
anyone help me the below request:
the report has main menu
date applivation decription
====================================
1/11/08 Accounts M&C
=====================================
1. 1/11/08 M&C details 40
2. 1/11/08 M&C Accounts 6

how do I GO THIS MENU
FROM MAIN MENU <SENDKEYS>S
IT WILL COME TO THIS MENU AND ENTER DATE AUTO PREVIOUS DAY
AND SENDKEYS<TAB>ACCOUNTS<TAB>M&C
HOW DO I GET PREVIOUS DAY AUTOMATCIALLY



 




ram,

WHAT previous day?

Are you referring to the previous day from 1/11/08?

Is that the previous CALENDAR day or the previous WORKING day?

The previous day is usually PrevDay = SomeDate - 1 IF SomeDate is a REAL DATE and not just a STRING. You may have to COMVERT a string to a REAL DATE using the DateSerial function.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
sorry skip, Mis comunication. previous working day
 



Do you have a Working Data calendar? You must also include holidays in the calendar. Companies usually have a working day calendar to reference. In the manufacturing industry we have an MDAY (manufacturing day) calendar in an Oracle table. I query the table to get the previous working day.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Skip
this is the report i am taking in excel sheet from Attachmate extra!. the above macro everybody is using
but the problem is if it is long week end it does not work, so i should modify this code.
is it possible
If today is Monday,then check Fridays data else check yesterday's data.
If strDayStamp="Mon" Then
strYesterdayDate=format(CVar(Date)-3, "mm/dd/yy") 'For weekend (Friday)
ElseIf strDayStamp="Saturday" then
strYesterdayDate=format(CVar(Date)-1, "mm/dd/yy") 'Date for previous day.
ElseIf strDayStamp = "Sunday" Then
strYesterdayDate=format(CVar(Date)-1, "mm/dd/yy") 'Date for previous day.
Else
strYesterdayDate=format(CVar(Date)-1, "mm/dd/yy") 'Date for previous day.
End If

TodayDate = Format(now, "Mmmm yyyy")

'strYesterdayDate = "12/24/07"
 




But how does your program know, that Friday or Monday was or was not a holiday?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
skip
i want only previous day the above code mention if it is saturdya it oges friday's date, only problem it is long weekend
'strYesterdayDate = "12/24/07"
in that case it opens the above line and chang it in manually previus day. do you have any idea other than this one
 



" do you have any idea other than this one"

See if your company has a workday calendar.

If not, then I'd make a workday calendar that I would update every year with the company holidays. Sor of the same thing as you might do with the WORKDAY function in Excel Analysis Toolkit.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
iwill check it and let you know thanks Skip. adn for teh above query

1. 1/11/08 M&C details 40
2. 1/11/08 M&C Accounts 6
ok this menu how do i select first one or second one
 




select, based on WHAT?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Skip
sometime M&C details will be in 2.
in that case how can i identify which one is first? and which one is second?
 



You would select each line the same way that you select any other line. I do not understand the difficulty.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Skip

Sess0.Screen.SENDKEYS("S< Enter>")in 8/030
so how do i write the code
 




Ram,

YOU could get this right out of Attachmate HELP!!!
[tt]
rc = object.GetString (Row, Col, Length, [Page])

Element Description
rc The returned screen text.
object The Screen object.
Row The row where the text string begins.
Col The column where the text string begins.
Len The length of the text string.
Page VT session only -- the screen page.Note: This parameter is ignored for release 6.0 of EXTRA!o.

Copyright 1996 - 1999, Attachmate Corporation. All rights reserved.
[/tt]

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Skip
i dont have attachment HELP. i am helping all my things from tek-tip forum
thanks for your help
actaully i would like to do the following
IF THE POSITION 04/09 = "" THEN ( NOTE: URAD DAL POSITIN WILL BE 04/088
FIND ASSETS, LIBILITIES, TOTAL LOSS, TOTAL NET
PUT IT IN EXCEL SHEET 1
URAD DAL
ASSETS 00 00 00 00
LIABLITIES 50 40 80 20
TOTAL LOSS 30 30 30 30
TOTAL NET 30 30 30 30


ELSE
THE POSITION 04/09 = "Z" THEN
FIND ASSETS , LIABITES
URAD DAL
ASSETS 00 00 00 00
LIABILITES 50 40 30 20
THE POSITION 04/088 WOULD BE VARY WITH EACH PAGE
HOW DO I PUT IT IN EXCEL SHEET THE PART OF TEH SCREEN





 



"i dont have attachment HELP"

If you have your Extra session open, your HELP files ought to be available.

I already suggested using Instr function to find the location of "ASSETS" & "LIABLITIES"

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
SKIP
I WRITE THE FOLLIWHNG CODE, SOMEHTING MISSING HERE,IN THIS CODE

If UCase(Sess.Screen.GetString(04, 98, 1)) = "" then


ASSETS = Sess.Screen.GetString(19, 72, 2)
ObjWorksheet.Cells(10, 3).Value = ASSETS ' ASSETS

LIABILITES = Sess.Screen.GetString(19, 72, 2)
ObjWorksheet.Cells(10, 5).Value = CDN EQUI 'LIABILITES

TOTAL LOSS = Sess.Screen.GetString(19, 97, 2)
ObjWorksheet.Cells(10, 8).Value = US EQUI 'TOTAL LOSS

TOTAL NET = Sess.Screen.GetString(19, 112, 2)
ObjWorksheet.Cells(10, 9).Value = BOOK 1 ' TOTAL NET

else if UCase(Sess.Screen.GetString(04, 98, 1)) = "z
 

Please use Process TGML codes to delimit your CODE submissions...
Code:
If UCase(Sess.Screen.GetString(04, 98, 1)) = "" then
       
          
     ASSETS = Sess.Screen.GetString(19, 72, 2)
      ObjWorksheet.Cells(10, 3).Value = ASSETS ' ASSETS

      LIABILITES = Sess.Screen.GetString(19, 72, 2)
      ObjWorksheet.Cells(10, 5).Value = CDN EQUI  'LIABILITES

     TOTAL LOSS = Sess.Screen.GetString(19, 97, 2)
      ObjWorksheet.Cells(10, 8).Value = US EQUI  'TOTAL LOSS

     TOTAL NET = Sess.Screen.GetString(19, 112, 2)
      ObjWorksheet.Cells(10, 9).Value = BOOK 1  ' TOTAL NET
 [b]   
elseif [/b]UCase(Sess.Screen.GetString(04, 98, 1)) = "z"[b] Then
    'WHAT???
End If[/b]
Might be simpler and better understood using Select Case
Code:
Select Case UCase(Sess.Screen.GetString(04, 98, 1))        
  Case ""
     ASSETS = Sess.Screen.GetString(19, 72, 2)
      ObjWorksheet.Cells(10, 3).Value = ASSETS ' ASSETS

      LIABILITES = Sess.Screen.GetString(19, 72, 2)
      ObjWorksheet.Cells(10, 5).Value = CDN EQUI  'LIABILITES

     TOTAL LOSS = Sess.Screen.GetString(19, 97, 2)
      ObjWorksheet.Cells(10, 8).Value = US EQUI  'TOTAL LOSS

     TOTAL NET = Sess.Screen.GetString(19, 112, 2)
      ObjWorksheet.Cells(10, 9).Value = BOOK 1  ' TOTAL NET
   
   Case "z"
     'WHAT???
End Select



Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
sKI
IF IT IS "Z" THEN
i have to find the 'ASSETS"
GETSTRING SEARCH "ASSETS"
IF IT IS THERE CORRESPONDING VALUE PUT IT IN EXCEL
HOW DO I DOTHAT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top