Alpha Video Training
Results 1 to 4 of 4

Thread: A little guidance

  1. #1
    Member
    Real Name
    Steven Greer
    Join Date
    Jun 2008
    Location
    Manchester,PA
    Posts
    379

    Default A little guidance

    I'm trying to learn a few code tricks and not sure how to convert a { / / } date format to a Char format. And maybe there is an eaiser way to do what i want, "I'm sure there is"
    Code:
    entt = cdow(date())
    IF entt = "Wednesday" then
    	
    week_start = convert_type(date()-6,"C")
    week_end = convert_type(date(),"C")
    
    'pay_week = week_start + week_end
    end if
    
    ?week_start
    = {03/18/2010}
    trying to make a payroll tracking system and i want to be able to get week start and week end into 1 variable, pay_week. I keep getting variable errors.

  2. #2
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,877

    Default Re: A little guidance

    Your dates are still dates. the {} around them is telling you that

    try this:

    Code:
    week_start = dtoc(date())
    
    ?week_start
    = "03/24/2010"
    
    Week_end = Dtoc(date()+6)
     
    ?week_end
    = "03/30/2010"
    
    pay_period = Week_start+"-"+week_end
    
    ?pay_period
    = "03/24/2010-03/30/2010"
    Tom

  3. #3
    Member
    Real Name
    Steven Greer
    Join Date
    Jun 2008
    Location
    Manchester,PA
    Posts
    379

    Default Re: A little guidance

    Code:
    ?dtoc(week_start)+" "+dtoc(week_end)
    that is what i was trying to do dtoc() seems to do it

  4. #4
    Member
    Real Name
    Steven Greer
    Join Date
    Jun 2008
    Location
    Manchester,PA
    Posts
    379

    Default Re: A little guidance

    this is what i was aiming for
    Code:
    entt = cdow(date())
    IF entt = "Wednesday" then
    
    week_start = date()-6
    week_end = date()
    end if
    dim global dweek
    dweek = dtoc(week_start)+" - "+dtoc(week_end)
    ?dweek
    = "03/18/2010 - 03/24/2010"

Similar Threads

  1. Security Guidance
    By johngtatp in forum Application Server Version 9 - Web/Browser Applications
    Replies: 18
    Last Post: 09-17-2009, 11:27 AM
  2. need guidance please
    By richard2007 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 15
    Last Post: 09-05-2009, 10:24 AM
  3. Guidance
    By jkukuda in forum Alpha Five Version 7
    Replies: 4
    Last Post: 04-14-2006, 06:11 PM
  4. windows guidance
    By shaun in forum Alpha Five Version 5
    Replies: 6
    Last Post: 10-25-2002, 10:22 AM
  5. Guidance needed
    By Scott Emerick in forum Alpha Five Version 5
    Replies: 9
    Last Post: 09-08-2002, 06:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •