I got it.
Thanks PHV.
As you my mentor, could you help me general question below?
It seems like it can code as VBA or sql. What case VBA prefers over sql and vise versa?
thanks for your great help.
wuju
Hello PHV,
My data type in Access 2007 is just NUMBER, so I am not sure it is Single or integer, or something else.
My answer to you as Single is what I actually want it to be.
I scrolled down to choose type of data, Access 2007 gives the choice of number, autonumber, text,....., but not a...
by the way, at least I have solution for having backward.
MWh to KWh and [1]/[1]*1000.
If you can help me in KWH to MWh in three decimal, it is good, otherwise I change to Wh to KWh and [1]/[1]*1000.
Thank you for your great help.
regards,
wuju
Hi PHV,
Thank you for your advise.
It looks like working well except that it always have integer number. I want to keep decimal point (up to .001)
Is it possible to convert KWh to MWh in three decimal?
For example, if 1234 KWh then I want to see 1.234 MWh.
Please let me know if you have idea...
Hi Dhoocom,
I coded as below as you suggested and ran it.
Nothing happended in my importMeter_t.
Could you help me out why this is not working?
Regards,
Wuju
FYI, the following is my coding.
Option Compare Database
Option Explicit
Private Sub convertKWh2MWh()
Dim strSQL As String
strSQL...
hi MajP,
Thank you for your great help.
Even though I am new to the VBA, I would like to coding, so your help has been great.
Method to having sql to select the desired records to convert in MWh is good, but original MWh data in importMeter_t is removed since sql only select the data which...
Hi MajP,
Can I just conditioning with pID as below?
If rs.Fields("pID") <= 22 Or (rs.Fields("pID") >= 51 And rs.Fields("pID") <= 57) Or rs.Fields("pID") = 63 Then
Option Compare Database
Option Explicit
Public Sub covertKtoM()
'your name here
Const tblName = "importMeter_t"
Dim i As...
Hi MajP,
Thank you for your advise.
It seems like you have very good idea, and I really want to follow your direction.
Since I am new to the database, sql and VBA (I just started to learn database two month ago), I kinda understant your advise, but not quite whole things especially making sql...
Thanks majP for quick respond.
Some of data are in MWh even though numbers are more than 1000. I would like sort and convert data in KWh to MWh based on pID. I know which pID are in KWh(pDI= 1~22, 51~57, and 63) and which are in MWh(pID=58~62, and 64~66). So could you give example of coding...
Howdy,
I need to convert some records (not all) in my access table to match with same unit.
I have a access table with mismatch in unit: some in kilowatt and some in megawatt.
I want to unify unit in megawatt and update the table.
The following is the access table I have with fields pID...
Howdy,
I need to convert some records (not all) in my access table to match with same unit.
I have a access table with mismatch in unit: some in kilowatt and some in megawatt.
I want to unify unit in megawatt and update the table.
The following is the access table I have with fields pID...
One of thing I want to do is to automate data converting (import) task from 2003 Excel to 2007 Access using visual basic.
There is an obstacle. Data in Excel are different format than I want to have in Access table, so can’t just use built-in importing step in Access.
What is the best way...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.