AT NEW AND AT FIRST AND AT LAST

WHAT IS THE FUNCTION OF AT NEW AND AT FIRST AND AT LAST?
Title edited by: Alvaro Tejada Galindo on Dec 24, 2007 7:46 AM

They are used inside loops to evaluate the value of a field....The value if the first, is it a new value, and so on...
Greetings,
Blag.

Similar Messages

  • Am going to get a new iPhone, my first and need some advice...

    Hello-
    I have been looking at getting an iPhone 4. I currently am with Verizon but both contracts (cell and data) are up so I was thinking about their iPhone 4. I have no idea if there is a difference between the way ATT deals with the calls, texts, internet and a carrier like Verizon. I am assuming the phone is the same and the OS will be the latest and the same. I did read that Verizon uses the CDMA network not the network 4GLTE. I guess when the 4G network is more of a network they might offer the option to choose.
    Does anybody know if tethering is available with any of the carriers yet or is that what either 3G or 4G should help with? If so, since 3G has been a network for sometime, and a darn good one at Verizon, what is the deal with tethering. I remember going with my friend when the iPhone first came out and ATT told them that a "concept" called tethering will be out in about a few months. I do not think after 5 years it has been out.
    I am open to all kinds of advice, cautions, suggestions, etc. as I embark on this new endeavor. being a tech nerd (in a negative way) I am nervous about how to deal with all of the functions without ruining the p[hone, which is what I usually do to the computers. I would like a super heavy duty case with a covering for the display (that allows the touch function to work). If there are choices with the iPhone 4, I would like to hear people's opinion of certain ones. Even apps. is it OK to get them on the apple website or iTunes or both? Are there apps that have been checked by Apple and are like Apple certified?
    I would like (but not sure if it is possible) to be able to travel and use the internet out in the desert, for example. I have a Verizon MiFi2200 and I use that for my MacBook and it works great. Do they have something like that for the iPhone.
    OK, that should be enough for now. OH, one more thing. Does it matter if I get applecare right of or wait until the initial warranty is about to expire before I purchase Applecare. I realize the phone sup[port will not be available to me if I wait but the genius bar and sending the camera in will be.
    Thanks a lot!

    Read here: http://support.apple.com/kb/HT2109.

  • How do I bulk edit contact's nicknames to first and last names?

    i imported contacts to the contacts app and they all say "NoName".
    i click on one of them and the first and last name fields are empty but the nickname field has the first and last name in it.
    how can i bulk edit 1120 contacts to change the full nickname to a first and last name?
    ex: "First"  ~  "Last"  ~  "Nickname"
           "Blank"  ~  "Blank"  ~  "John Smith"
    i want to to be:
           "John"  ~  "Smith"
    help me create an applescript or use a program or something cuz its killing me....thanks
    ohh and i used both of the following applescripts and nothing happened:
    tell application "Address Book"
       set all_Persons to every person in group "Test"
       repeat with per_son in all_Persons
           set nknm to per_son's nickname
           set per_son's first name to word 1 of nknm
           set per_son's last name to word -1 of nknm
       end repeat
    end tell
    ANDDDDDD
    tell application "Address Book"
       set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, space}
       repeat with onePerson in (get people whose nickname is not missing value)
           set N to text items of (get nickname of onePerson)
           tell contents of onePerson
               set first name to text items 1 thru -2 of N as text
               set last name to text item -1 of N as text
           end tell
       end repeat
       set AppleScript's text item delimiters to ASTID
    end tell
    neither did anything...

    to any1 that wants to use the scripts and have them work just type "save" on the next like after end tell and itll do it........

  • Please read my question carefully, this is, I think, a question for the experts. It's not the usual name change question.   When I setup my new MacBook Pro, something slipped by me and my computer was named First-Lasts-MacBook-Pro (using my real first and

    Please read my question carefully, this is, I think, a question for the experts. It's not the usual name change question.
    When I setup my new MacBook Pro, something slipped by me and my computer was named First-Lasts-MacBook-Pro (using my real first and last name).
    I changed the computer name in Preferences/Sharing to a new name and Preferences/Accounts to just be Mike. I can right click on my account name, choose advanced, and see that everything looks right.
    However, If I do a scan of my network with my iPhone using the free version of IP Scanner, it lists my computer as First-Lasts-MacBook-Pro! And it lists the user as First-Last.
    So even though another Mac just sees my new computer name, and my home folder is Mike, somewhere in the system the original setup with my full name is still stored. And it's available on a network scan. So my full name might show up at a coffee shop.
    Can I fully change the name without doing a complete re-install of Lion and all my apps?

    One thought... you said the iPhone displayed your computer's old name? I think that you must have used the iPhone with this computer before you changed the name. So no one else's iPhone should display your full name unless that iPhone had previously connected to your Mac. For example, I did this exact same change, and I use the Keynote Remote app to connect with my MacBook Pro. It would no longer link with my MacBook Pro under the old name, and I found that I had to unlink and then create a new link under the new name. So the answer to your question is, there is nothing you need to do on the Mac, but rather the phone, and no other phone will display your full name.

  • DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" ?

    WHAT IS THE DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" WITH REFERENCE TO CONTROL BREAK STATEMENTS ? PLEASE EXPLAIN IN DETAIL.
    BEST REGARDS
    RYAN.

    Hi
    i am sending you a simple program in which i had write program on that events
    you can understand very easily
    Using AT FIRST , AT NEW, AT THE END OF , AT LAST.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1 TYPE I,
          F2(6) TYPE C,
          F3(10) TYPE N,
          F4(16) TYPE P DECIMALS  2,
          END OF ITAB.
    DATA: SUB_TOT(10) TYPE P DECIMALS 3.
    **--1
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 30.
    ITAB-F4 = '3000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *--2
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *-- 3
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    SORT ITAB BY F1.
    LOOP AT ITAB.
    AT FIRST.
    WRITE: /35 ' MATERIAL DETAILS:'.
    ULINE.
    ENDAT.
    AT NEW F1.
    WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
    ULINE.
    ENDAT.
    WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.
    SUB_TOT = SUB_TOT + ITAB-F4.
    AT END OF F1.
    ULINE.
    WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
    CLEAR SUB_TOT.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: 'SUM:', ITAB-F4.
    ULINE.
    ENDAT.
    ENDLOOP.
    Using AT FIRST , AT NEW, AT THE END OF , AT LAST.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1 TYPE I,
          F2(6) TYPE C,
          F3(10) TYPE N,
          F4(16) TYPE P DECIMALS  2,
          END OF ITAB.
    DATA: SUB_TOT(10) TYPE P DECIMALS 3.
    **--1
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 30.
    ITAB-F4 = '3000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *--2
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *-- 3
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    SORT ITAB BY F1.
    LOOP AT ITAB.
    AT FIRST.
    WRITE: /35 ' MATERIAL DETAILS:'.
    ULINE.
    ENDAT.
    AT NEW F1.
    WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
    ULINE.
    ENDAT.
    WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.
    SUB_TOT = SUB_TOT + ITAB-F4.
    AT END OF F1.
    ULINE.
    WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
    CLEAR SUB_TOT.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: 'SUM:', ITAB-F4.
    ULINE.
    ENDAT.
    ENDLOOP.
    <b>Reward if usefull</b>

  • My question is How to do old 4S to new 5 S to save same into phone but can not do ask someone last night and did not help me as I am deaf and not clear and Please man told me download from computer and I am not understand at all

    Yesterday We went to At and T store and they told me to download from old phone to new phone and I am really upset and I got Icloud and prove but part of still in 4S and has not go in 5S and that is biggest problem and no commuication that woman stay follow what she said but still not working so I do not know what else to do my do not understand and I would like to have someone do for us and AT and T store can not do that part so Told me Apple store and I called last night talk to some one on Apple store but told me that no go back to AT and T store so now total confuse and I am not get anywhere so and why they will not do it so therefore I do not think computer that not clear for us because we have no experince in computer program for this so both are deaf and not clear so over 50 years age and so we need face someone to do for us and told us do our self which is total upset us more so because my twins are in Orlando and can not call them because of problem contiunes in heart so I need someone who we can trust and help us. I do have IPAD mini and almost lost my calls to my twins and today I think get back but not 100 % so I am kind upset and who email us or I will have to go Apple Store and see if they know personal.

    Open this support document http://support.apple.com/kb/HT2109 print it from the computer and follow the steps there. You need to backup your data from the first device and then restore that to the new device.

  • Just installed itunes on new windows 7 system  Cant get it to import cd's when it is open.  I have to close it first and then insert cd to import

    just installed itunes on new windows 7 system  Cant get it to import cd's when it is open.  I have to close it first and then insert cd to import. any one know how to fix this?

    If your library was working on your computer and then popped up empty all of a sudden then this might be what you need...
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • Get first and last day given month name with combobox

    hi guys ;
    I loaded to month name in combobox and I want to get first and last day by the name of month from selected Combobox
    So if I select to february than results get 01.02.2015 and 28.02.2015
    if select March than 01.03.2015 and 31.03.2015
    Thanks .

    Thank you for useful post , How to change Culturinfo as a Turkish Month name ?
    your's code is work if I use English month name But it was get error when use the turkish month name
    If you are running your application on a Turkish Windows you could use the System.Globalization.CultureInfo.CurrentCulture:
    int month = DateTime.ParseExact(monthName, "MMMM", System.Globalization.CultureInfo.CurrentCulture).Month;
    Or you could use create an explicit culture object like this:
    System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("tr-TR");
    int month = DateTime.ParseExact(monthName, "MMMM", ci).Month;
    Please remember to mark all helpful posts as answer to close your threads.

  • FM for First and Last Day_Current Month

    Hello All,
    Inorder to update the TVARV table, two new variables were needed which will get the First and Last Day of current month.
    One FM i was able to find was BKK_GET_MONTH_LASTDAY which takes the Todays date and outputs the Last date of the month. IS there any FM for FIRSTDAY Current month....
    Regs,
    -PSK

    Hi Sravan,
    Following help may help you.
    FM - BUILD_PERIOD_TABLE
    code is mentioned below.
    data: it_cperiod type table of range_prds with header line,
    define one variable as range like -
    ranges: r_cperiod for sy-datum,
    CALL FUNCTION 'BUILD_PERIOD_TABLE'
        EXPORTING
          YEAR         = <current year>
        TABLES
          PERIOD_TABLE = it_cperiod.
      read table it_cperiod with key per_id = <current month>
      refresh r_cperiod.
      r_cperiod-sign = 'I'.
      r_cperiod-option = 'BT'.
      r_cperiod-low = it_cperiod-begda.
      r_cperiod-high = it_cperiod-endda.
      append r_cperiod.
    Now, you can see begin and end of moth in r_cperiod.
    Regards,
    Parag

  • First and last frame disappearing off every clip

    Hi,
    Every clip I import in Final cut pro 6.0 loses its first and last frame.
    The clips I import are in photoJpeg / 24p (verified with the -get info- of Quicktime Pro), but once in FCP they are marked as 23.98 ?!?!
    In the browser the info of the clip says 23.98 and also indicates that the clip is 2 frames shorter.
    When opened in the viewer the first and last frames are really missing.
    It gets worse, when a clip is longer (ie: 500 frames), the first and last TWO frames are missing ?!?!
    Am I alone with this problem?
    Please help!!!

    How are these clips getting created? Quicktime does not necessarily associate each frame with a certain TC, and the frame rate is dynamically calculated, rather than simply being hard-coded into the QT metadata. This results in Quicktimes that get created outside of FCP often showing up with different frame rates than you expect.
    You might try exporting movies back out of FCP, ether from the master clips, or from sequences. I have noticed that when I export from a sequence at the correct frame rate, the missing frames come back. Other tools that might come in handy are Compressor for converting batches of files to QTs that FCP will like better, and Cinema Tools for conforming clips to a particular frame rate (like changing them from 24 to 23.98)
    You might also try Dumpster which is a bare-bones utility that will allow you to view and edit the QT metadata directly.
    Try some experiments and post back and let us know what you find out. I found that placing the clips in sequences at the proper frame rate and exporting new movie files worked well, but I have seen timing and frame rate shifts with some clips using this method...
    Hope this helps -
    Max Average

  • Chunk expressions: Need the first and last char position from member.word[x]?

    I need to build a linear list of the string positions of the
    first and last character of each word in a string. For example if I
    have the string myPet = “DOG CAT FISH” then myList =
    [[1,3],[5,7],[9,12]]
    myPet.word[x] will let me access the individual words but
    I’m not sure how to get the char position of the beginning
    and end of each. Please help, it’s Friday and my brain has
    left for the weekend.

    Touche, Sean.
    "Sean Wilson" <[email protected]> wrote in
    message
    news:fqa8ap$bga$[email protected]..
    > Hi Craig,
    >
    > Your's fails if any word is repeated. Try it with "DOG
    CAT FISH DOG"
    >
    > This one seems to work, although there are probably more
    efficient ways to
    > go about it. A regular expression and the PRegEx xtra
    would certainly be
    > quicker, especially as the string gets longer
    >
    > on mGetWordBoundaries aString
    > -- basic error check
    > if stringP(aString) = 0 then return []
    > if length(aString) = 0 then return []
    >
    > lWhitespace = [SPACE, TAB, RETURN, numToChar(10)]
    > tStart = 1
    > tChar = aString.char[tStart]
    > repeat while lWhitespace.getPos(tChar)
    > tStart = tStart + 1
    > tChar = aString.char[tStart]
    > end repeat
    >
    > lPositions = []
    > repeat with w = 1 to aString.word.count
    > tEnd = tStart + aString.word[w].char.count - 1
    > lPositions.append([tStart, tEnd])
    > tStart = tEnd + 1
    > tChar = aString.char[tStart]
    > repeat while lWhitespace.getPos(tChar)
    > tStart = tStart + 1
    > tChar = aString.char[tStart]
    > end repeat
    > end repeat
    > return lPositions
    > end

  • Syncing with Outlook is reversing first and last name

    In Outlook 2007 when I add a new contact and type in the full name (say John Doe) it puts in the full name field "John Doe" and files it as Doe, John. This is how I have always done it and all of my contacts are setup like that.
    When I add a contact from my iPhone and sync it with Outlook, it transfers over the data fine but when it inserts the new contact it files it as lastname, firstname (as it should) but also puts lastname, firstname in the "Full Name" Field (ie Doe, John).
    Is there any way to have it sync contacts from the iPhone to Outlook and keep the Full name as "Firstname Lastname" instead of inserting it as "Lastname, Firstname". I feel as though I've tried everything in Outlook 2007 that I can think of with no luck.
    Normally I would just change Outlook to work the way the iPhone inserts the contacts, but I use Plaxo to sync with my Macbook and Address Book tends to switch the contacts around, back to the way it should be (firstname lastname).
    Any help would be a lifesaver! Driving me nuts...
    iPhone   Windows XP Pro  

    The setting in AB's preferences controls the display order. On a person's card, you can have the contents of the first name field in the database displayed before or after the last name field.
    When mail adds an address to the address book data base it uses the information in the From: header. It assumes that text such as "Joe Soap"<[email protected]> consists of first name Joe last name Soap and address [email protected] If however the header appears as "Joe, Soap"<[email protected]> then mail will put Joe in the last name and Soap in the first name fields in the AB database.
    Basically, the order of names in the AB database is dependant on how your sender (or their mail program) has formatted the From: header.
    I think.
    AK

  • How to split 'Firstname Lastname' into 2 columns 'First' and 'Last'?

    I import a .csv file from PayPal that throws the customer's First name, MI and Last Name all in one column. I have no problem going through and deleting the middle initial to make just two words separated with a space.
    How can I split the First and Last names that are separated by a space into two separate columns? It's a piece of cake in Excel, but for some stupid reason, I can't use Excel 08 for Mac to do it. Keeps saying that there is data in column #XX without a heading (there is no data there) when I try to import to PayPal Multi-order shipping.
    Please help! I'm desperate. Taking me for ever to cut and past each last name into the new column.
    Thanks for any help with this!
    Marcus

    Here is a script which does the trick.
    --[SCRIPT splitfirst_lastname]
    Enregistrer le script en tant que Script ou Application : splitfirst_lastname.xxx
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner la colonne de chaînes à découper (et éventuellement davantage pour définir la colonne recevant les noms propres).
    Aller au menu Scripts , choisir Numbers puis choisir splitfirst_lastname
    Le script découpe les chaînes sources au premier espace.
    Le prénom remplace la chaîne initiale.
    Le reste est déposé dans la cellule adjacente à droite ou dans la cellule de la denière colonne sélectionnée.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    Sous 10.6.x,
    aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
    puis cocher la case "Afficher le menu des scripts dans la barre des menus".
    --=====
    Save the script as a Script or an Application : splitfirst_lastname.xxx
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a column of strings to split (and maybe more columns to define the column receiving lastNames).
    Go to the Scripts Menu, choose Numbers, then choose "splitfirst_lastname"
    The script split the source strings on the first embedded space.
    The FirstName replace the original string.
    The reminder is stored in the cell adjacent on the right (or in the last column of the selected range.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/02/23
    --=====
    on run
    run script doyourduty
    end run
    --=====
    script doyourduty
    set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    if colNum2 = colNum1 then set colNum2 to colNum1 + 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    repeat with r from rowNum1 to rowNum2
    tell row r
    set first_last to value of cell colNum1
    if (first_last is not 0.0) and first_last contains space then
    set in_pieces to my decoupe(first_last, space)
    set value of cell colNum1 to item 1 of in_pieces
    set value of cell colNum2 to my recolle(items 2 thru -1 of in_pieces, space)
    end if
    end tell -- row
    end repeat
    end tell -- Numbers
    end script
    --=====
    set {rowNum1, colNum1, rowNum2, colNum2} to my getCellsAddresses(dname,s_name,t_name,arange)
    on getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
    local two_Names, row_Num1, col_Num1, row_Num2, col_Num2
    tell application "Numbers"
    set d_Name to name of document d_Name (* useful if we passed a number *)
    tell document d_Name
    set s_Name to name of sheet s_Name (* useful if we passed a number *)
    tell sheet s_Name
    set t_Name to name of table t_Name (* useful if we passed a number *)
    end tell -- sheet
    end tell -- document
    end tell -- Numbers
    if r_Name contains ":" then
    set two_Names to my decoupe(r_Name, ":")
    set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, item 1 of two_Names)
    if item 2 of two_Names = item 1 of two_Names then
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    else
    set {row_Num2, col_Num2} to my decipher(d_Name, s_Name, t_Name, item 2 of two_Names)
    end if
    else
    set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, r_Name)
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    end if -- r_Name contains…
    return {row_Num1, col_Num1, row_Num2, col_Num2}
    end getCellsAddresses
    --=====
    set { dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    on getSelParams()
    local r_Name, t_Name, s_Name, d_Name
    set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
    if r_Name is missing value then
    if my parleAnglais() then
    error "No selected cells"
    else
    error "Il n'y a pas de cellule sélectionnée !"
    end if
    end if
    return {d_Name, s_Name, t_Name, r_Name} & my getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
    end getSelParams
    --=====
    set {rowNumber, columnNumber} to my decipher(docName,sheetName,tableName,cellRef)
    apply to named row or named column !
    on decipher(d, s, t, n)
    tell application "Numbers" to tell document d to tell sheet s to tell table t to ¬
    return {address of row of cell n, address of column of cell n}
    end decipher
    --=====
    set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers" to tell document 1
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    try
    (selection range of table y) as text
    on error errMsg number errNum
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    return {theDoc, theSheet, theTable, theRange}
    end try
    end repeat -- y
    end if -- x>0
    end tell -- sheet
    end repeat -- i
    end tell -- document
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mercredi 23 février 2011 10:18:36

  • How to find first and last date of a fiscal week using SQL

    Hello,
    I want information about FISCAL Week, means a Week based on ISO standard. I know format strings ‘IW’ or ‘IYYY’ gives fiscal week and fiscal year respectively from a given date. But I want to find the first and last date of a fiscal week. Say suppose I have a fiscal week is 2, and fiscal year is 2008, how to find the start and end date of the given fiscal week.
    Any kind of help would be greatly appreciable.
    Thanks,
    Prince

    davide gislon wrote:
    The following query evaluate the begin of a fisical week, where &year and &week are respectively the year and week you want to calculate.
    To evaluate the end of the week you have to add 6.
    Note that my database is set to have monday as day number 1 of the week, and sunday as day number 7; if your database settings are different you should modify the query accordingly.
    SELECT CASE TO_CHAR(TO_DATE('&year','YYYY'),'D')
    WHEN '1' THEN TO_DATE('&year','YYYY')+((&week-1)*7)
    WHEN '2' THEN TO_DATE('&year','YYYY')+((&week-1)*7-1)
    WHEN '3' THEN TO_DATE('&year','YYYY')+((&week-1)*7-2)
    WHEN '4' THEN TO_DATE('&year','YYYY')+((&week-1)*7-3)
    WHEN '5' THEN TO_DATE('&year','YYYY')+((&week-1)*7+3)
    WHEN '6' THEN TO_DATE('&year','YYYY')+((&week-1)*7+2)
    WHEN '7' THEN TO_DATE('&year','YYYY')+((&week-1)*7+1)
    END BEGIN_FISICAL_WEEK
    FROM DUAL
    Hope this is helpful.
    Cheers,
    Davide
    Edited by: davide gislon on 08-Jan-2009 07:19Your query does nothing you say it does. TO_DATE('&year','YYYY') returns first day of the current month for year &year. And the only reason it returns January 1, &year is that we are currently in January:
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-JAN-05
    SQL> As soon as we roll into February:
    SQL> alter system set fixed_date = '2009-2-1' scope=memory
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    01-FEB-09
    SQL> select TO_DATE('&year','YYYY') from dual
      2  /
    Enter value for year: 2005
    old   1: select TO_DATE('&year','YYYY') from dual
    new   1: select TO_DATE('2005','YYYY') from dual
    TO_DATE('
    01-FEB-05
    SQL> alter system set fixed_date = NONE scope=both
      2  /
    System altered.
    SQL> select sysdate from dual
      2  /
    SYSDATE
    08-JAN-09
    SQL> But even if TO_DATE('&year','YYYY') would always return January 1, &year, or you would fix it to TO_DATE('0101&year','MMDDYYYY') it still would be wrong. ISO week rules are
    If January 1 falls on a Friday, Saturday, or Sunday, then the week including January 1 is the last week of the previous year, because most of the days in the week belong to the previous year.
    If January 1 falls on a Monday, Tuesday, Wednesday, or Thursday, then the week is the first week of the new year, because most of the days in the week belong to the new year.Therefore, next year:
    SQL> DEFINE YEAR=2010
    SQL> DEFINE WEEK=1
    SQL> ALTER SESSION SET NLS_TERRITORY=GERMANY -- enforce Monday as first day of the week
      2  /
    Session altered.
    SQL> SET VERIFY OFF
    SQL> SELECT CASE TO_CHAR(TO_DATE('0101&&year','MMDDYYYY'),'D')
      2  WHEN '1' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7)
      3  WHEN '2' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-1)
      4  WHEN '3' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-2)
      5  WHEN '4' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7-3)
      6  WHEN '5' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+3)
      7  WHEN '6' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+2)
      8  WHEN '7' THEN TO_DATE('0101&&year','MMDDYYYY')+((&&week-1)*7+1)
      9  END BEGIN_FISICAL_WEEK
    10  FROM DUAL
    11  /
    BEGIN_FI
    04.01.10
    SQL> SELECT TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') FROM DUAL
      2  /
    TRUNC(TO
    28.12.09
    SQL> 2 user10772980:
    Use:
    SELECT  TRUNC(TO_DATE('0101&&year','MMDDYYYY'),'IW') + (&&week-1)*7 FISCAL_YEAR_&&YEAR._WEEK_&&WEEK
      FROM  DUAL
    FISCAL_YEAR_2010_WEEK_1
    28.12.09
    SQL> SY.

  • Swapping the first and last characters in a column

    Hi,
    Fairly new to T-SQL and i want to swap the first and last characters in a column.
    Thanks
    Umar Javed

    Likewise i have also tried your suggestion and i still seem to be getting errors:
    IF (@TYPE = 'SCRAMBLE')
    BEGIN
    DECLARE @SQLCOMMAND VARCHAR(2000)
    SET @SQLCOMMAND = 'UPDATE ' + @TABLENAME + ' SET ' + @VALUE +
    STUFF(STUFF(@VALUE,1,1,RIGHT(@VALUE,1)),LEN(@VALUE),1,LEFT(@VALUE,1))
    EXECUTE(@SQLCOMMAND)
    END
    Umar Javed
    Please post the errors.
    EDIT: Actually looking at your code this will bring errors:
    IF (@TYPE = 'SCRAMBLE')
    BEGIN
    DECLARE @SQLCOMMAND VARCHAR(2000)
    SET @SQLCOMMAND = 'UPDATE ' + @TABLENAME + ' SET ' + @VALUE + ' = STUFF(STUFF('+@VALUE+',1,1,RIGHT('+@VALUE+',1)),LEN('+@VALUE+'),1,LEFT('+@VALUE+',1))'
    PRINT @SQLCOMMAND
    EXECUTE(@SQLCOMMAND)
    END
    I've also added a print command so it will show you what the code looks like upon concatenation. It's much easier to debug this way.

Maybe you are looking for