[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

as 400 date/time query

Asked by whsrptg in Programming for iSeries / AS400, DB2 Database

hi all,

I'm trying to run a query from VBA, which I will be moving to VB6 once it's installed on my work PC. basically I need to get some records between 2 dates.

the code works as far as getting the right date time for starting and ending. but when the query runs against the AS/400 I dont get anything back. below are some examples of what's being sent and what is in the database itself.

sending:
Start Date/Time: 2009-08-30-17:01:00.0000000
End Date/Time: 2009-08-31-12:00:00.0000000

Actual data from database: 2009-08-30-21.27.21.000000 and 2009-08-30-21.47.41.000000

both of which fall between the date/times sent.

I'm at a loss how to do this. I've never really worked with the AS/400 but have done a lot with sql server and the dreaded Access sql.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
NewStart_DateTime = Format(NewStart_DateTime & " " & Left(CODAM1, StartPosition) & ":" & Right(CODAM1, 2) & ":00", "mm/dd/yyyy hh:nn:ss AMPM")
NewStart_DateTime = DateAdd("n", -(CODAM3), NewStart_DateTime)
NewStart_DateTime = Format(NewStart_DateTime, "yyyy-MM-dd-hh:mm:ss.0000000")
        
If Len(CODAM2) = 3 Then
       StartPosition = 1
Else
       StartPosition = 2
End If
 
NewEnd_DateTime = Format(CurrentSheet.Cells(4, 2) & " " & Left(CODAM2, StartPosition) & ":" & Right(CODAM2, 2) & ":00", "mm/dd/yyyy hh:nn:ss AMPM")
NewEnd_DateTime = DateAdd("n", CODAM3, NewEnd_DateTime)
NewEnd_DateTime = Format(NewEnd_DateTime, "yyyy-MM-dd-hh:mm:ss.0000000")
        
GetEmployee_SQL = " SELECT cpttst, cptopc, cptclc " & _
                            " FROM CPETT00 " & _
                            " WHERE cptemp= '" & Neweeempn & "' " & _
                            " And date(timestamp('" & NewStart_DateTime & "')) <= date(timestamp(CPTTST)) " & _
                            " And date(timestamp('" & NewEnd_DateTime & "')) >= date(timestamp(CPTTST)) " & _
                            " ORDER BY CPTTST "
[+][-]08/31/09 01:15 PM, ID: 25226039Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for iSeries / AS400, DB2 Database
Sign Up Now!
Solution Provided By: Kdo
Participating Experts: 2
Solution Grade: A
 
[+][-]08/31/09 12:00 PM, ID: 25225356Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 12:04 PM, ID: 25225396Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 12:05 PM, ID: 25225407Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 12:09 PM, ID: 25225455Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 12:14 PM, ID: 25225490Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 12:16 PM, ID: 25225502Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 12:37 PM, ID: 25225669Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 12:39 PM, ID: 25225692Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 01:01 PM, ID: 25225907Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 01:04 PM, ID: 25225939Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 01:19 PM, ID: 25226077Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 01:23 PM, ID: 25226118Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/31/09 01:25 PM, ID: 25226134Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 01:32 PM, ID: 25226218Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 01:34 PM, ID: 25226231Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 01:36 PM, ID: 25226255Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 01:36 PM, ID: 25226256Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 01:38 PM, ID: 25226278Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 02:28 PM, ID: 25226713Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 02:28 PM, ID: 25226714Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625